A
Ang Talunin
Hey,
I'm trying to create a perl script to download a zip file from a
website.
This is my code to download the file:
my $ua = new LWP::UserAgent;
my $reg = new HTTP::Request 'GET',"http://www.site.com/file.zip";
my $result = $ua->request($reg);
$html = $result->content if $result->is_success;
open OUT, ">file.zip" || die "Cannot write to outputfile";
print OUT $html;
close OUT;
But the stored zipfile is corrupted....
So I think that there's something wrong with the way I pass the file
from the HTTP request to the file, but can't find the right
solution....
Does anybody knows how to do this without corrupting the file? Thanx!
A.T.
I'm trying to create a perl script to download a zip file from a
website.
This is my code to download the file:
my $ua = new LWP::UserAgent;
my $reg = new HTTP::Request 'GET',"http://www.site.com/file.zip";
my $result = $ua->request($reg);
$html = $result->content if $result->is_success;
open OUT, ">file.zip" || die "Cannot write to outputfile";
print OUT $html;
close OUT;
But the stored zipfile is corrupted....
So I think that there's something wrong with the way I pass the file
from the HTTP request to the file, but can't find the right
solution....
Does anybody knows how to do this without corrupting the file? Thanx!
A.T.