Hi,
I have a big problem... I've written a script that uses gzip to compress log files then transfers them every night using Net::FTP to another machine. The script is running on a UNIX server and putting the files on a windows server. These log files are quite large, we are talking about 10megs compressed per day. The script runs every night and just transfers the previous days files for a series of virtual hosts.

Anyway, my problem is that the logs seem to becoming corrupted somewhere and once they are on the destination server I cannot uncompress them. When using WinZip I get the message 'Invalid Compressed Data -- unable to inflate.'

My first thought was that I needed to transfer the files in binary mode and maybe the default was ascii mode FTP, can anyone confirm this? I tried changing the mode type using $ftp->quot("bin") or die "Failed to change to binary type:$!"; because I could not find any other way of changing file transfer type. Can anyone tell me the proper way of doing this?

All comments and ideas very welcome, I need to get this sorted ASAP because we have clients screaming for their web stats....

Cheers!
Tom


In reply to Net::FTP Corrupting zip files by CodeJunkie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.