On Nov 7, 2005, at 12:39, Dhanashri Bhate wrote:
Hello,
Thanks for responding! :)
Yes, if I manually do the same things I do get a zip file!
The difference is in the sizes of these files, the File downloaded
via the
script is a little bigger (about 20 KB) than the File downloaded
manually
with a browser (the file sizes are in MBs)
That comment was the key. I bet a beer this is a newline issue. The
implementation of save_content() is:
sub save_content {
my $self = shift;
my $filename = shift;
open( my $fh, ">", $filename ) or $self->die( "Unable to
create $filename: $!" );
print $fh $self->content;
close $fh;
}
But a zip file would need to be written in binary mode on Windows.
I don't see a way to specify that in the interface, so maybe you
could store the content yourself.
open my $fh, ">", $filename or die $!;
binmode $fh;
print $fh $mech->content;
close $fh;
-- fxn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>