Yes. Exist the Net::FTP module. The following text comes from the Oreilly's
book "Perl in a Nutshell"

16.2 Net::FTP
Net::FTP is used to transfer files from remote hosts. Using Net::FTP, you
can write simple FTP clients that transfer files from remote servers based
on information passed on the command line or from hard-coded variables. Here
is an example of a client that connects to a remote FTP server and gets a
file from the server:

#!/usr/local/bin/perl -w

use Net::FTP;

$hostname = 'remotehost.com';
$username = 'anonymous';
$password = '[EMAIL PROTECTED]';

# Hardcode the directory and filename to get
$home = '/pub';
$filename = 'TESTFILE';

# Open the connection to the host
$ftp = Net::FTP->new($hostname);         # construct object
$ftp->login($username, $password);       # log in

$ftp->cwd($home),"\n";                   # change directory
print $ftp->ls($home),"\n";

# Now get the file and leave
$ftp->get($filename);
$ftp->quit;
FTP clients have also been integrated with most World Wide Web browsers,
using ftp:// in place of http://. When the URL points to a directory, the
browser displays a listing of the directory, where each filename is a link
to that file. When the URL points directly to a file, the remote file is
downloaded.

Here's an example that uses Net::FTP to list files from a remote FTP server
on a web page, with a link from each file to the URL of the file on the
remote site:

#!/usr/local/bin/perl -w

use Net::FTP;

$hostname = 'remotehost.com';           # ftp host
$username = 'anonymous';                # username
$password = '[EMAIL PROTECTED]';      # password
$home = '/pub';

$ftp = Net::FTP->new($hostname);        # Net::FTP constructor
$ftp->login($username, $password);      # log in w/username and password

$pwd = $ftp->pwd;                       # get current directory

# Now, output HTML page.
print <<HTML;
Content-type: text/html
<HTML>

  <HEAD>
    <TITLE>Download Files</TITLE>
  </HEAD>
  <BODY>

      <B>Current working directory:</B> $pwd<BR>
      Files to download: <P>
HTML

    @entries = $ftp->ls($home);       # slurp all entries into an array
    foreach (@entries) { # now, output links for all files in the ftp area
                         # as links
        print "<INPUT TYPE=hidden NAME=\"files\" VALUE=\"$_\">\n";
        print "<A HREF=\"ftp://$hostname$_\";>",
        "<IMG SRC=\"http://www/icons/f.gif\"; border=0>\n";
        print " $_</A><BR>\n";
    }
    print <<HTML;
  </BODY>
</HTML>
HTML
$ftp->quit;             # end FTP session
The Net::FTP module implements a subset (as shown earlier in this chapter)
of the FTP protocol as defined in RFC 959. In addition to providing the
methods shown below, the module inherits from Net::Cmd. Some of the Net::FTP
methods return an object derived from the dataconn class (which is in turn
derived from the IO::Socket::INET class), as noted in the entries for those
methods.

The following methods are defined by Net::FTP:

new
abort
appe
append
authorize
ascii
binary
byte
cdup
cwd
delete
dir
ebcdic
get
list
login
ls
mdtm
mkdir
nlst
pasv
pasv_wait
pasv_xfer
pasv_xfer_unique
port
put
put_unique
pwd
quit
quot
rename
retr
rmdir
size
stor
stou
supported
type
unique_name


----- Original Message -----
From: "William Black" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 27, 2002 3:23 PM
Subject: re: autoftp


> Hello All,
>
> Does anyone know if perl offers an autoftp module?  If they do what is it
> and how does it work.
>
> Cheers,
>
> William Black
>
>
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to