LWP::Simple getstore problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
On my WinXP machine with Activeperl 5.8.8, I'm trying to download a jpg
file using getstore as follows:

use LWP::Simple;

getstore("http://mysvr.testenv.com/test001.jpg", "test001.jpg");


The resulting file is a broken image.

However, the same script running on my OpenBSD box brings the jpg file down

Any tips/hints, please?

Thanks in advance....


Re: LWP::Simple getstore problem

vt wrote:
Quoted text here. Click to load it
It could be because LWP not store file as binary. Try this:

use LWP::Simple;

my $content = get("http://mysvr.testenv.com/test001.jpg");
open FILE,"> test001.jpg" or die "Can't create file";
binmode FILE;
print FILE $content;
close FILE;

This code will work on Linux platform too becasue 'binmode' is meaningless under
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail.
Send me your mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>

Re: LWP::Simple getstore problem

Quoted text here. Click to load it

Yes, utilizing binmode was going to be my next option. However, I have
seen feedback posted by some that say getstore works fine for binaries
under Windows. Until I get feedback from anyone who got it to work, I
guess I'll just go the binmode route.

Thanks, Petr....

Site Timeline