Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I uploaded foobar.txt in the same folder using an absolute path and at run time I get PK=8†0 foobar.txtadadasddsC™ PK=8†0C™ ¶foobar.txtPK8=.
This proves two things though. It proves it can find the foobar.txt and is goofing around with it and also proves it can read it "adadasdds" is the entirety of the text file. I get this text message to browser, it doesn't die or anything and no popup window exists. What should I do?
#!/usr/bin/perl use warnings; use CGI::Carp 'fatalsToBrowser'; $|++; use strict; use CGI qw/:standard/; use Archive::Zip; my $fileToUpload = 'foobar.txt'; my $zip = Archive::Zip->new(); open( my $fh, '<', $fileToUpload ) or die "open failed: $!"; binmode( $fh ); # for win32 my $contents = do { local $/; <$fh> }; close( $fh ); $zip->addString($contents, $fileToUpload); print header( -type => 'application/zip', -attachment => "$fileToUpload.zip" ); binmode( STDOUT ); # once again, for win32 $zip->writeToFileHandle(\*STDOUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: question about a reply to the Zip::Archive post
by tachyon (Chancellor) on Apr 08, 2004 at 03:47 UTC | |
by Anonymous Monk on Apr 08, 2004 at 03:55 UTC | |
by Anonymous Monk on Apr 09, 2004 at 03:02 UTC | |
by tachyon (Chancellor) on Apr 09, 2004 at 03:18 UTC | |
|
Re: question about a reply to the Zip::Archive post
by Mr. Muskrat (Canon) on Apr 08, 2004 at 02:10 UTC | |
by Anonymous Monk on Apr 08, 2004 at 03:50 UTC | |
|
Re: question about a reply to the Zip::Archive post
by Anonymous Monk on Apr 08, 2004 at 05:00 UTC |