Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save a picture

Status
Not open for further replies.

Nashtrump1

Programmer
Joined
Sep 1, 2006
Messages
11
Location
GB
Hi there,

Im spidering a website and doing well so far.
I need to save pictures that i come across so i can see what the data im extracting relates to.

Does anyone know of a way or a module that saves pictures?

Ive googled it but cant find anything.

Kind regards

Nash
 
Just get the picture file like you get anything else. When you save it, use binmode. Example with LWP-Simple

Code:
use LWP::Simple;

my $picture_binary = get "[URL unfurl="true"]http://domain.com/logo.gif";[/URL]

open (SAVE, "./local_copy.gif");
binmode SAVE;
print SAVE $picture_binary;
close (SAVE);

-------------
Cuvou.com | The NEW Kirsle.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top