Trying to use php to get all files in a directory and save them locally... It seems like I constantly need to specify a name? Is that right?
function grabFiles() {
$conn = ftp_connect(REMOTE);
@ftp_login($conn, REMOTEUSER, REMOTEPASS);
ftp_get($conn, '*', FTP_BINARY);
}
You can get a list of all the files using ftp_nlist
:
http://www.php.net/manual/en/function.ftp-nlist.php
Go through that array and download each file using ftp_fget
:
http://www.php.net/manual/en/function.ftp-fget.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With