Work notes upload _php tutorials with PHP to write FTP files

Source: Internet
Author: User
Tags ftp connection
$ftp _server = "*.*.*.*"; $ftp _user = "Lu"; $ftp _pass = "Love You";
Set up a connection or die$conn_id = Ftp_connect ($ftp _server) or Die ("couldnt connect to $ftp _server");
$login _result = Ftp_login ($conn _id, $ftp _user, $ftp _pass);
if ((! $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";}
Try to login $filename =date (YMD). ". XML "; $source _file= "/usr/local/ivr/sendwireless/xml/data/". $filename; Source address echo $source _file; $destination _file= "/itc/admin/logstat/ftplog/". $filename; Destination Address $upload = Ftp_put ($conn _id, $destination _file, $source _file, ftp_binary) or Die ("couldnt connect to $ftp _server"); Ftp_quit ($conn _id);

if (! $upload) {echo "FTP upload have failed!";} else {echo "uploaded $source _file to $ftp _server as $destination _file"; }ftp_close ($conn _id);

http://www.bkjia.com/PHPjc/531896.html www.bkjia.com true http://www.bkjia.com/PHPjc/531896.html techarticle $ftp _server = *.*.*.*; $ftp _user = lu; $ftp _pass = love,//set up a connection or die$conn_id = Ftp_connect ($ftp _se RVer) or die (couldnt connect to $ftp _server); $login _result = ...

  • Related Article

    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.