Hello Monks,
I am trying a simple file upload, and am only getting a 0-byte file at the destination. Code and debug log:
my $ftp = Net::FTP->new("my.ftp.server", Debug => 1, Passive => 1) or +return; $ftp->login("myuser","mypass") or return; $ftp->cwd($dir) or $ftp->mkdir($dir, 1); $ftp->cwd($dir) or return; $ftp->binary; $ftp->put($file) or return; $ftp->quit or return;
The FTP server is pure-ftpd on Linux, and of course I have tested it to work with other clients
>>> USER myuser <<< 331 User myuser OK. Password required >>> PASS .... <<< 230-User myuser has group access to: 100 33 16 <<< 230 OK. Current directory is / >>> CWD /temp/ <<< 250 OK. Current directory is /temp >>> CWD /temp/ <<< 250 OK. Current directory is /temp >>> TYPE I <<< 200 TYPE is now 8-bit binary >>> ALLO 1800 ^^ this is the correct file size <<< 200 dc.w $4E71 >>> PASV <<< 227 Entering Passive Mode (1,2,3,4,117,65) >>> STOR New Text Document (2).txt <<< 150 Accepted data connection <<< 226 File successfully transferred >>> QUIT <<< 221-Goodbye. You uploaded 0 and downloaded 0 kbytes. ^^ 0 bytes?! <<< 221 Logout.

In reply to found a bug in Net::FTP? by rgcosma

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.