But we are able to transfer files through command task. i mean manually logging into ftp server.

When you say this, do you mean that you can transfer files between pairs of machines or that you can do the kind of third-party introduction that you're doing with the pasv_xfer method? You should be able to do pairwise transfers, but pasv_xfer is very problematic with address translation.

You should be able to use code something like this (I haven't tested this particular code):

$src_ftp_conn->get($val) or die "Cannot get $val: ", $src_ftp_conn->message, "\n"; $tgt_ftp_conn->put($val) or die "Cannot put $val: ", $tgt_ftp_conn->message, "\n";

You're probably getting a disconnect because one of the firewalls is saying "WTF!?" and hanging up. The firewall has to actually look at the numbers in the PORT command, make adjustments in its tables, then write out a new PORT command with different numbers. You're sending a PORT command from system A with an IP address for system B and the firewall doesn't know what to do. Or, at least, that's my guess.

There's some information on how this works here: http://www.ncftp.com/ncftpd/doc/misc/ftp_and_firewalls.html


In reply to Re^3: NET::FTP Connection reset by peer by ReturnOfThelonious
in thread NET::FTP Connection reset by peer by srinivasvkumar

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.