in reply to Re: Correct Perl settings for sending zipfile to browser
in thread Correct Perl settings for sending zipfile to browser

The downloaded zip is NOT the same size as the one on the server. The one on the server is SMALLER.

For example, commenting out the "unlink" lines of the code to leave the files as-is on the server, then comparing them, finds that whereas on the server it shows 2,002,621 bytes in the zipped file, the downloaded file shows 4,568,860 bytes, and unzip claims an additional 942,843,300 bytes are missing, despite the fact that the unzipped .txt file on the server had only 12,145,337 bytes. Irritatingly unexplainable, so far.

Yes, the file starts with "PK".

  • Comment on Re^2: Correct Perl settings for sending zipfile to browser

Replies are listed 'Best First'.
Re^3:Correct Perl settings for sending zipfile to browser
by bliako (Abbot) on Nov 15, 2019 at 19:53 UTC

    \r\n aka CRLF should be used to separate the headers. Use a module like CGI to print the headers so you don't have to worry about that.

Re^3: Correct Perl settings for sending zipfile to browser
by soonix (Chancellor) on Nov 15, 2019 at 03:24 UTC
    After commenting out the unlink, could you unzip the file successfully on the server?

      Yes, the created zip file can be unzipped without a hint of an issue on the server, and the resulting .txt file looks perfect.