PHP Implementation of Curl Analog FTP upload method, phpcurlftp upload
This article describes the PHP implementation of the Curl analog FTP upload method. Share to everyone for your reference. Specific as follows:
<?phpfunction upload ($dir, $src, $dest) { $ch = Curl_init (); $fp = fopen ($src, ' R '); curl_setopt ($ch, Curlopt_url, ' ftp://user:pwd@host/interpretation/'. $dir. ' /'. $dest); curl_setopt ($ch, curlopt_upload, 1); curl_setopt ($ch, Curlopt_infile, $fp); curl_setopt ($ch, Curlopt_infilesize, FileSize ($SRC)); Curl_exec ($ch); $error _no = Curl_errno ($ch); Curl_close ($ch); if ($error _no! = 0) { return 0; } else{ return 1;} } upload ("Images", "s.py", "aaa.py"); >
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/1039180.html www.bkjia.com true http://www.bkjia.com/PHPjc/1039180.html techarticle PHP Implementation of the method of Curl analog FTP upload, phpcurlftp Upload This example describes the PHP implementation of the Curl simulation FTP upload method. Share to everyone for your reference. Specific as follows: Phpfunction u ...