Not really a PHP question - more an FTP protocol question - try reading the
FTP RFC at http://www.ietf.org/rfc/rfc959.txt

However, in a nutshell, to get all of the files in a directory -

1. get a listing of that directory (read the RFC for instructions) and store
the filenames in an array.
2. go through the array using a foreach - to 'RETR' each file.

HTH

Danny.


----- Original Message -----
From: "Jose Arce" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 04, 2002 8:33 PM
Subject: [PHP] FTP routine


> Hi, i'm making a script to donwload files from a ftp server to the server
> hosting the script, but i don't know how to download all the files from a
> directory. I'm using the file system functions to conect to the ftp
server,
> because the ftp functions in php does not always work, and, actually  they
> suck
>
>         @fputs($conexion,"RETR file.zip\r\n");
> echo @fgets($conexion,256);
> echo "<br>" ;
>
> I think that works, but i don't know how to retrive all the files from a
> directory. Also (ppff!! thats a lot of questions) some people say i can
> resume these downloads when i use fsockopen...is that true?. Oh yes, i
> almost forgot, when downloading large files, the script dies, is there a
> chance to let the script die, but the process can go on, and when it's
> finished send a email or something telling me that it transfer the files?
>
> Thx :D
>
> PD: English is not my languaje, sorry ñ_ñ
>
>
> _________________________________________________________________
> MSN. Más Útil cada Día. http://www.msn.es/intmap/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to