PHP calls FTP

Source: Internet
Author: User
<?php//set up basic connection$ftp_server = ' ftp.com '; FTP Server $ftp_user_name = ' username '; $ftp _user_pass = ' userpass '; $conn _id = ftp_connect ($ftp _server); Login with username and Password$login_result = ftp_login ($conn _id, $ftp _user_name, $ftp _user_pass); Check connectionif ((! $conn _id) | | (! $login _result)) {        echo "FTP connection has failed!";        echo "Attempted to connect to $ftp _server for user $ftp _user_name";        Exit;    } else {        echo "Connected to $ftp _server, for user $ftp _user_name";    }//upload the File$upload = Ftp_put ($conn _id, $ Destination_file, $source _file, ftp_binary); Check upload statusif (! $upload) {        echo "FTP upload have failed!";    } else {        echo "uploaded $source _file to $ Ftp_server as $destination _file ";    } Close the FTP streamftp_close ($conn _id);? >

PHP calls FTP

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.