PHP implementation of the image upload to the FTP code, PHP Novice ...
I have implemented the use of PHP to upload the image path to the online database, and now I want to upload the image to a folder in the FTP, please the master to help you ... Thank you...
------Solution--------------------
If you have an FTP account, just 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 the contents of the FTP directory
So after the FTP upload, execute a PHP program to complete the new data warehousing work
And this program is just to traverse the directory, to determine whether the original files in the library, and make the appropriate operation on it
------Solution--------------------
Your server is FTP, you should have FTP account
Simply use the FTP management software to log in to modify, or use the Linux command