Update of /cvsroot/curl/curl-www/libcurl/php/examples
In directory labb:/tmp/cvs-serv27859
Modified Files:
authors.txt
Added Files:
ftpupload.php ftpupload.php.html
Log Message:
ftpupload.php the VERY simple examples have their uses too
Index: authors.txt
===================================================================
RCS file: /cvsroot/curl/curl-www/libcurl/php/examples/authors.txt,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- authors.txt 11 Nov 2005 23:28:52 -0000 1.2
+++ authors.txt 13 Nov 2005 09:36:32 -0000 1.3
@@ -6,3 +6,4 @@
multi.php Roman Rozanov
multipartpost.php Pete James
linkchecker.php <a title="Michael Phipps is a PHP Programmer located in Brisbane, Queensland, Australia." href="http://michaelphipps.com" >Michael Phipps</a>
+ftpupload.php Daniel Stenberg
--- NEW FILE: ftpupload.php ---
<?php
//
// A simple PHP/CURL FTP upload to a remote site
//
$ch = curl_init();
// we upload a JPEG image
curl_setopt($ch, CURLOPT_URL,
"ftp://mynamw:[email protected]/path/to/destination.jpg");
curl_setopt($ch, CURLOPT_UPLOAD, 1);
curl_setopt($ch, CURLOPT_INFILE, "me-and-my-dog.jpg");
// set size of the image, which isn't _mandatory_ but helps libcurl to do
// extra error checking on the upload. If you can tell me how to get filesize
// nicely with a PHP function then I'd like to add it here to make the example
// better!
curl_setopt($ch, CURLOPT_INFILESIZE, 3271);
$error = curl_exec ($ch);
// check $error here to see if it did fine or not!
curl_close ($ch);
?>
--- NEW FILE: ftpupload.php.html ---
FTP upload to a remote site
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.