Tangled issue ftp download
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 the 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 execute this sentence
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
}
------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.