Board index » delphi » GIF/JPEG d/l Via HTTP?

GIF/JPEG d/l Via HTTP?


2005-08-31 02:14:26 PM
delphi98
Hi..
I hope this is the right group for this post..
I am looking for a simple way to download a GIF file from a website..
Basically, I just want to download a 24 hour radar loop from the weather.com
website for a project I am working on. I'd like to write a small Delphi
app to load the GIF file and save it with a time and date stamp as the
filename (2005-08-30-1600) and have the app do this on some kind of
interval and then leave the app running on my desktop PC while I am at
work..
I have played around with the browser component, but I can not find a way to
grab the image file from the page..
Any tips would be great..
Thanks,
Rich
 
 

Re:GIF/JPEG d/l Via HTTP?

Quote
I am looking for a simple way to download a GIF file from a website..

Basically, I just want to download a 24 hour radar loop from the
weather.com
website for a project I am working on. I'd like to write a small
Delphi
app to load the GIF file and save it with a time and date stamp as the
filename (2005-08-30-1600) and have the app do this on some kind of
interval and then leave the app running on my desktop PC while I am at
work..

I have played around with the browser component, but I can not find a way to
grab the image file from the page..

Any tips would be great..
Use a HTTP client component sur as Indy or ICS.
With ICS, your code would looks like:
HttpCli1.URL := 'www.weather.com/images/radar.gif';
HttpCli1.RcvdStream := TFileStream.CReate('radar.gif', fmCreate);
HttpCli1.Get;
HttpCli1.RcvdStream.Free;
// Then you can load the file into your favorite GIF image component.
To find the URL for the image, use IE to get the page, then right click on
the image, select properties and take the image URL. Alternatively, you can
look at the HTML source code and search for the IMG tag and take the URL.
Youy can download ICS full source code from www.overbyte.be. Have a
look at HttpTst sample program to know more about the component.
--
PS: On peut aussi me joindre sur le forum news://news.delphinaute.be/delphi