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.