Hi,
your solution won't help. The picture was a jpg, but it was damaged during downloading (the last bytes were missing). I used
failed=CALL DLL(1,"URLDownloadToFileA",0,from$,to$,0,0)
which reports whether the download was successfully started, but not successfully finished. At the moment I just check after downloading whether the file size is correct, to prevent this specific mistake.
However, I can't guarantee that the server reports always the correct size. Therfore I just wanted to make sure the programm didn't crash.
I have attached a sample pic.
sberk
PS: Since I'm not sure whether I have all necessary rights to upload the original picture I used one from wiki commons and created the same probleme.
http://commons.wikimedia.org/wiki/File:Black-tailed_gull.jpg?uselang=en
I'm not the photographer of this picture, it was me, Bamse, and all license details can be found there.
PPS: just to make it clear, the wiki picture is correct, the attached picture is the destroyed one