July 04, 2024, 03:14:18 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Save GIF from internet

Started by LarryMc, May 28, 2008, 07:45:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

May 28, 2008, 07:45:22 AM Last Edit: May 28, 2008, 12:05:03 PM by Larry McCaughn
Looking for minimum code to save .gif file from internet to harddisk without using a browser window.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

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? ;)

Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

sapero

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

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library