Trying to list files in a FTP directory
Here is what I have so far.
In reading my O'Reily PHP book it states I can use readdir()
But I'm unsure how to write and use CURL.
Will this work $ch = readdir(opendir(curl_init("ftp://user:pass@images.cwrelectronics.com/images/")));
Here is my code
Thx
Steve
<?PHP
$ch = curl_init("ftp://user:pass@images.cwrelectronics.com/images/");
$fh = fopen('/home/content/s/t/e/xxxxxxxxx/html/backroom/cwrimagelist.txt','w');
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY,"http://proxy.shr.secureserver.net:3128");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_URL, $URL);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
curl_setopt ($ch, CURLOPT_FILE, $fh);
curl_exec ($ch);
curl_close ($ch);
fclose($fh);
?>