FTP Download Ftp_get Total error Cannot find the file do not know what reason, the local path cannot write absolute path?
$remote _file = "2014-05-30_10-27-24-db.sql"; $local _file = "E:\\wamp\\www\\qc.sql";//(DirName (__file__)). " /.. /.. /beifen/2014-05-29_17-11-00-db.sql ";//verify user name and password www.jb51. Net$login_result = Ftp_login ($conn _id, $ftp _user_name, $ftp _user_pass);//Gets the size of the specified file if (! $conn _id) | | (! $login _result)) {echo ' failed to connect to FTP server '; exit;} else {//print_r (Ftp_chdir ($conn _id, $remote _file)), Var_dump (Ftp_pwd ($conn _id)),//$a = (dirname (__file__)). " /.. /.. /beifen/2014-05-29_17-11-00-db.sql "; Var_dump (Ftp_chdir ($conn _id," Images ")); FTP_PASV ($conn _id,true); Return to the pattern, this is very strange, some FTP server must perform this if (Ftp_get ($conn _id, $local _file, $remote _file, ftp_binary)) { echo " Successfully written to $local _file\n ";} else { echo "there was a problem\n";} Close FTP connection ftp_close ($conn _id); }
Reply to discussion (solution)
First, the file absolute path to print out to see if it is correct, to the FTP server to confirm whether this file
If so, verify that the FTP user has permission to access this file.
is the local path error, the server is not a problem, I put it in the root directory
I'm not sure if the local absolute path under Windows can
Is there a great God to help you out, thank you very much