Thread: ftp

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    2
    Rep Power
    0
    How do I FTP all of the files in a directory from one server to a directory on another server?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    Alkmaar, The Netherlands
    Posts
    123
    Rep Power
    14
    Do you want to do it with Perl or with a FTP program? And why do you post this question twice?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    2
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by MeijdenB:
    Do you want to do it with Perl or with a FTP program?
    I want to do it with a perl program.

    And why do you post this question twice? Just an itchy clicker finger, I guess. Sorry.
    [/quote]

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    300
    Rep Power
    14
    Go to CPAN and download the Net::FTP module. Then read its docs, and then you will be set. If you wnat to get really "dangerous" then go and read the RFC for FTP, and learn something about sockets and read the documentation that comes with IO::Socekt module (bundled with Perl 5.004 and higher).

    My reccomendation is to download the module...
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    10
    Rep Power
    0
    Although you could write your own program, it would be much easier to use the "prox" command in ftp on unix/linux. You can also find some windows programs to do this but I can't remember any..

    To use the prox command here is an example>

    ftp> open <site 1> <port>
    ^ connect to site 1
    ftp> prox open <site 2> <port>
    ^ connect to site 2
    ftp> cd public_html
    ^ change to desired dir on site 1
    ftp> prox cd public_html
    ^ ditton on site 2
    ftp> prompt
    ^ diable prompting (depending on what your doing)
    ftp> prox mget *.html
    ^ put all *.html files from site 1 to site 2

    for more info just read the ftp man

    or if it needs to be dynamic or something you could try using a Perl program to write a .netrc file or something similar that contains these commands
    and then just call ftp from within perl.

    Regards
    Ravi


    [This message has been edited by r-c (edited October 17, 2000).]

IMN logo majestic logo threadwatch logo seochat tools logo