I am trying to get ftp to work through php to move a file to another server (not on the same lan). I already have this separated so it will happen when certain conditions are meet. But I must be missing something. Here is the important parts of the script.
$ImgFile='../auci/incoming/'.$ImgFil;
//echo $ImgFil;
//echo $ImgFile;
$fp = fopen($ImgFil, 'r');
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if($login_result){
echo "Login is good!";
}
ftp_pasv($conn_id, true);
if (ftp_fput($conn_id, $ImgFile, $fp, FTP_ASCII)) {
echo "Successfully uploaded $ImgFil\n";
}
else{
echo "There was a problem while uploading $ImgFil\n";
}
fclose($fp);
ftp_close($conn_id);
I end up with the same result "There was a problem while uploading PictureName".
Any help is appreciated.
FNP