I'm losing my mind - please help ;-0
Can someone show simply how to FTP a file using curl/php to a remote ftp site?
My sample code is below, which doesn't work, and I don't know why. It causes internal server errors. Curl is installed properly and does work with php - if I comment out the curl_setopt lines, I get the ftp site directory outputted.
thanks for ANY direction,
Greg
<?
$ch = curl_init ("ftp://uname:pword@www.mysite.com/");
$fp = fopen("file.txt","r");
curl_setopt($ch,CURLOPT_INFILESIZE,filesize("file.txt"));
curl_setopt($ch,CURLOPT_INFILE,$fp);
curl_setopt($ch,CURLOPT_PUT,1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec ($ch);
curl_close ($ch);
fclose($fp);
?>