• Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving an image from URL to the harddisk  RSS feed

 
Bas Lintel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can someone help me with the following:
I want to get an image from the Internet (from a URL) and save it to the harddisk. Can someone help me with some code please? The main problem is the saving to the harddisk part.
Bas
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bas,
Something like this should do the trick:

Hope this helps,
Michael Morris
 
Bas Lintel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,
This helped a lot, thanks for the reply and your help.
Bas
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a note - that code will save ANYTHING off the web to disk. You can point it to static HTML, dynamic HTML, pictures, documents, configuration files, databases, etc. Point it to a non-existant image and get somebody's 404 page. Good clean fun.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!