Php is a beginner in php who transfers the image to the ftp.

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

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.