CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Fetching an image with LWP

 



Mel
Deleted

Jun 29, 2000, 7:21 PM

Post #1 of 3 (250 views)
Fetching an image with LWP Can't Post

How do you fetch an image that is not on the same machine.


Kanji
User / Moderator

Jun 30, 2000, 4:18 AM

Post #2 of 3 (250 views)
Re: Fetching an image with LWP [In reply to] Can't Post

LWP::Simple should suffice ...

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

#!/usr/bin/perl -w


use strict;
use LWP::Simple;


my $image = 'http://domain.com/image.gif';
my $save_as = 'image.gif';


my $status = mirror( $image, $save_as );
print "Crap! Couldn't get $image because of $status" if is_error( $status );</pre><HR></BLOCKQUOTE>

See the LWP::Simple docs for more help.


Mel
Deleted

Jun 30, 2000, 5:39 AM

Post #3 of 3 (250 views)
Re: Fetching an image with LWP [In reply to] Can't Post

It worked, thank you very much for taking time to help me.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives