Hello,
When I was faced with an ftp_get problem yesterday, I did a search on the forum for a solution. I found several people with the same problem but no answers.
I discovered 2 things:
the directory that you are saving to must be writable publicly. If not you will not be able to transfer the files.
if the file exists, it needs to be unlinked.
While I said only two, a third thing which may have had a factor was the local file had to be addressed to the root.
This was my solution:
<?php
$ftp=ftp_connect('ftp.source.com',21);
$login=ftp_login($ftp,'user','pass');
$ls=ftp_nlist($ftp,'*.xml');
$count=count($ls);
$local="/web/account/docs/dl_directory/";
for($i=0; $i<$count; $i++){
$get=$ls[$i];
$put=$local.$get;
if(is_file($put)){unlink($put);}
ftp_get($ftp, $put, $get, FTP_BINARY);
}
ftp_quit($ftp);
?>
Ron