Looking for minimum code to save .gif file from internet to harddisk without using a browser window.
Larry
Just a little hint... I am just now studying the browser_test.eba, one of the examples that came with EmergenceBasic. When testing the program I just held the cursor over a gif and right-clicked. Then a system menu appeared, and one of the choices offerred was "Save picture as". What can be be simpler than that? ;)
Thanks Egil
That's a no-brainer IF I wanted the user to have to do the saving. ;)
Guess I should have been just a "little" more specific: :-[
QuoteLooking for minimum code to save .gif file from internet to harddisk, without using a browser window.
Larry
Very simple$use "Wininet.lib"
$use "Urlmon.lib"
declare import, URLDownloadToFileA(comref pCaller,string szURL,string szFileName,_
int dwReserved, comref lpfnCB),int
declare import, DeleteUrlCacheEntryA(string szURL)
' optional, remove the file from browser's cache
DeleteUrlCacheEntryA("http://www.google.com/intl/en_ALL/images/logo.gif")
' then download it
if URLDownloadToFileA(0, "http://www.google.com/intl/en_ALL/images/logo.gif", "c:\\image.gif", 0, 0)
Messagebox 0, "download failed", ""
else
system "c:\\image.gif"
endif
Sapero,
I knew you were going to be the one with the answer. I was just waiting for you to get on.
As always, thanks a million.
Larry