Yaerox has asked for the wisdom of the Perl Monks concerning the following question:
When the download finished and I try to open the file the file is corrupt and got 0 bytes. On my webserver this file got an correct filesize, and if I download via FTP I can open the file without a problem. Using application/x-pdf instead of the above does not help too. I tried with Content-Transfer-Encoding: binary still same result.print "Content-Type: application/pdf\n"; print "Content-Disposition: attachment; filename=$MyPDF\n\n";
print "Content-Type: application/pdf\n"; print "Content-Disposition: attachment; filename=$MyPDF\n\n"; open FILE, "<", $MyPDF; my @aPDF = <FILE>; close FILE; print @aPDF;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI pdf got 0 bytes after downloading - compression problem?
by McA (Priest) on Nov 20, 2014 at 14:08 UTC | |
|
Re: CGI pdf got 0 bytes after downloading - compression problem?
by McA (Priest) on Nov 20, 2014 at 13:17 UTC | |
|
Re: CGI pdf got 0 bytes after downloading - compression problem?
by Corion (Patriarch) on Nov 20, 2014 at 13:13 UTC |