wfsp has asked for the wisdom of the Perl Monks concerning the following question:
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.
output#!/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;
resultFTP Server ready. User u41576016 logged in Type set to A Opening ASCII mode data connection for 032/docroot/test.html Transfer complete
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.<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>
Now, I admit this more than likely a combination of my ineptitude and Vista. A lethal combination! :-)
Can anyone shed any light on it?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::FTP and corrupted uploads
by sgifford (Prior) on Jun 06, 2008 at 20:03 UTC | |
Re: Net::FTP and corrupted uploads
by monarch (Priest) on Jun 06, 2008 at 17:57 UTC | |
Net::FTP and corrupted uploads has a patch
by thoglette (Scribe) on Feb 02, 2009 at 22:50 UTC |
Back to
Seekers of Perl Wisdom