Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2024-04-19 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found