Php implements code for uploading images to ftp. it is a beginner in php... I have used php to upload the image path to the online database. now I want to upload the image to a folder on ftp. please help me... Thank you... ------ Solution ------------------ if you have an ftp account, directly use the ftp tool. ------ Solution -------------------- PHP is a beginner in php who uploads images to ftp...
I have used php to upload the image path to the online database. now I want to upload the image to a folder on ftp. please help me... Thank you...
------ Solution --------------------
If you have an ftp account, you can directly use the ftp tool to upload it.
------ Solution --------------------
PHP code
$ Conn = ftp_connect ('ftp _ server'); $ result = ftp_login ($ conn, 'username', 'password'); if (ftp_put ($ conn, remote file path, local file path, FTP_ASCII) {echo "Upload succeeded";} else {echo "Upload failed";} ftp_close ($ conn );
------ Solution --------------------
Php cannot and does not need to perceive changes in content in the ftp directory.
Therefore, after the ftp upload is complete, run a php program to import new data to the database.
This program just traverses the Directory, determines whether the unique file is in the library, and makes corresponding operations.
------ Solution --------------------
If your server is FTP, you should have an FTP account
Simply use the FTP management software to log on and modify it, or use linux commands.