Good day. I am attempting to upload an ascii file to an ftp server that does not support PASV. The problem here is I am not specifying PASV in my script, Net::FTP is pulling that out of its ass. Even when I specify PORT, it still sends the PASV command. WTF? How do I prevent this? Script:
use Net::FTP; $ftp = Net::FTP-> new('blah.com',Debug => 1); $ftp-> login('blah', 'blah'); $ftp->port(); $ftp->ascii(); $ftp->cwd('/Inventory'); $ftp->put($file); $ftp-> quit();
and resulting debugging report
Net::FTP>>> Net::FTP(2.77) Net::FTP>>> Exporter(5.62) Net::FTP>>> Net::Cmd(2.29) Net::FTP>>> IO::Socket::INET(1.31) Net::FTP>>> IO::Socket(1.30_01) Net::FTP>>> IO::Handle(1.27) Net::FTP=GLOB(0x1d5cec4)<<< 220 Blah ready... Net::FTP=GLOB(0x1d5cec4)>>> USER blah Net::FTP=GLOB(0x1d5cec4)<<< 331 Password required for blah. Net::FTP=GLOB(0x1d5cec4)>>> PASS .... Net::FTP=GLOB(0x1d5cec4)<<< 230 User blah logged in. Net::FTP=GLOB(0x1d5cec4)>>> PORT 67,139,145,121,9,34 Net::FTP=GLOB(0x1d5cec4)<<< 200 Port command successful. Net::FTP=GLOB(0x1d5cec4)>>> TYPE A Net::FTP=GLOB(0x1d5cec4)<<< 200 Type set to A. Net::FTP=GLOB(0x1d5cec4)>>> CWD /Inventory Net::FTP=GLOB(0x1d5cec4)<<< 250 CWD command successful. "/Inventory" i +s current directory. Net::FTP=GLOB(0x1d5cec4)>>> ALLO 278912 Net::FTP=GLOB(0x1d5cec4)<<< 200 ALLO Ok : 41139867648 bytes available. Net::FTP=GLOB(0x1d5cec4)>>> PASV Net::FTP=GLOB(0x1d5cec4)<<< 501 PASV not allowed. Net::FTP=GLOB(0x1d5cec4)>>> QUIT Net::FTP=GLOB(0x1d5cec4)<<< 221 Goodbye.

In reply to Net::FTP Forcing PASV?? by rethaew

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.