Using php to control ftp file uploading has been simplified to the simplest code. why is there an exception? -Php Tutorial

Source: Internet
Author: User
The problem of using php to control ftp file uploading has been simplified to the simplest code. why are there still errors ??? The remote_fileaaa1.txt file under the $fileaaa.txt root directory; remote file $ conn_idftp_connect ($ server); $ login_resultftp_login ($ conn_id, $ the problem of using php to control ftp file uploading has been simplified to the simplest code. why is there still an error ???
$ File = 'aaa.txt '; // file in the root directory
$ Remote_file = 'aaa1.txt '; // remote file

$ Conn_id = ftp_connect ($ server );

$ Login_result = ftp_login ($ conn_id, $ username, $ password );

Ftp_pasv ($ conn_id, true );

If (ftp_put ($ conn_id, $ remote_file, $ file, FTP_BINARY, 0 )){
Echo "successfully uploaded $ file \ n ";
}
Else {
Echo "There was a problem while uploading $ file \ n ";
}

Ftp_close ($ conn_id );

// Error message: Warning: ftp_put () [function. ftp-put]: aaa.txt: Access is denied. in D: \ Program Files \ appserv \ www \ wx \ ftp. php on line 63
There was a problem while uploading aaa.txt

------ Solution --------------------
Access is denied
Access is denied.

------ Solution --------------------
Aaa.txt: modify the permission of this file. Make it readable, writable, and writable ......
------ Solution --------------------
Does ftp_put have the function of overwriting with the same name? No
------ Solution --------------------
Warning: ftp_put () [function. ftp-put]: aaa.txt: Access is denied. permission problems
------ Solution --------------------
Obviously, Mu has the right to participate in the speech of deputies to the National People's Congress.

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.