Tangled questions about FTP download

Source: Internet
Author: User
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.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.