#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Location
    Chicago, ILL
    Posts
    16
    Rep Power
    0

    Perl Net::ftp won't list files


    i been trying for last 2 days but i get the same problem.

    Net::FTP=GLOB(0x1ab29a4)>>> PORT 192,168,1,2,6,156
    Net::FTP=GLOB(0x1ab29a4)<<< 200 Port command successful.
    Net::FTP=GLOB(0x1ab29a4)>>> NLST /www/
    Net::FTP=GLOB(0x1ab29a4)<<< 150 Opening data connection for directory list.
    Net::FTP=GLOB(0x1ab29a4)>>> ¡ƯABOR
    Net::FTP=GLOB(0x1ab29a4)<<< 425 Cannot open data connection (10060).
    Net::FTP=GLOB(0x1ab29a4)<<< 226 ABOR command successful.

    heres the code im using to get file list
    @filelist = $ftp->nlst();
    forech (@filelist) {
    print "$_\n";
    }

    Why can't it connect. I also haven't found a good example so if you could help thanks.
  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Location
    The Emerald City
    Posts
    289
    Rep Power
    13
    Are you behind a firewall? Add this line before $ftp->nlst

    $ftp->pasv();

    This will change to passive mode.

    jaa
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Location
    Chicago, ILL
    Posts
    16
    Rep Power
    0
    already got it

IMN logo majestic logo threadwatch logo seochat tools logo