curl-and-php
Re: Moving files on an FTP server via libcurl
Date: Wed, 27 Jun 2007 17:42:54 -0700
Daniel,
I tried the approach you mentioned, but could not get it to work. Could
you please take a look at my code to see if I'm doing it the right way?
========================================================================================
$cobj = curl_init();
curl_setopt($cobj, CURLOPT_URL, $ftp_url);
curl_setopt($cobj, CURLOPT_RETURNTRANSFER,1);
curl_setopt($cobj, CURLOPT_VERBOSE, 1);
curl_setopt($cobj, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($cobj, CURLOPT_FTP_USE_EPSV, 0);
curl_setopt($cobj, CURLOPT_FTP_USE_EPRT, 0);
curl_setopt($cobj, CURLOPT_FTP_SSL, CURLFTPSSL_ALL);
curl_setopt($cobj, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($cobj, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($cobj, CUROPT_POSTQUOTE, array("RNFR $filename RNTO
old_datafiles/$filename"));
========================================================================================
Regards,
Vipin
On 6/27/07, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> On Wed, 27 Jun 2007, simon_at_ice.org wrote:
>
> > I thought the FTP rename syntax was:
> > rename [oldfile] [newfile]
>
> That's the syntax ftp clients usually use but it isn't really FTP
> protocol.
>
> > RNFR [oldfile]
> > RNTO [newfile]
>
> This is exactly how RFC959 tells us to do renames over FTP.
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
-- Regards, Vipin
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-06-28