I recently rebuilt Vista following a hard disk failure and I can no longer upload files without them being corrupted (lines truncated). It was fine before. My FileZilla FTP client works fine. But with Net::FTP there is some weirdness going on.
#!/usr/local/bin/perl use strict; use warnings; use Config::Simple; use Net::FTP; my $success; my %cnf; Config::Simple->import_from(q{cnf/sw.cnf}, \%cnf); my $ftp = Net::FTP->new($cnf{host}, Passive => 1) or die qq{cant connect: $!\n}; print $ftp->message; $success = $ftp->login($cnf{login}, $cnf{pwd}); print $ftp->message; $ftp->ascii; #$ftp->binary; print $ftp->message; my $local = q{c:/www/032/docroot/test.html}; my $remote = q{032/docroot/test.html}; $success = $ftp->put($local, $remote); print $ftp->message;
output
FTP Server ready. User u41576016 logged in Type set to A Opening ASCII mode data connection for 032/docroot/test.html Transfer complete
result
<html <head <title>ftp test</title <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1 +" </head <body <h1>ftp test</h1 </body </html>
With $ftp->ascii commented out and $ftp->binary uncommented I get
<html> <head> <title>ftp test</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1 +"> </head> <body> <h1>ftp test</h1> </body> </html>
Changing passive to 0 doesn't affect the outcome.

Now, I admit this more than likely a combination of my ineptitude and Vista. A lethal combination! :-)

Can anyone shed any light on it?


In reply to Net::FTP and corrupted uploads by wfsp

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.