cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: delete file from ftp with quote

From: Gaetano Favoino <gaetano.favoino_at_gmail.com>
Date: Tue, 30 Sep 2008 09:28:10 +0200

Hi guys, finally godaddy decided to reply to my messages and gave me the
solution of the problem:

"*Thank you for contacting Online Support. FTP connections to a third party
server via our proxy server are not supported when in a shared hosting
environment. While you are able to connect, any commands that are not
functioning will be due to this restriction. If you require this type of
functionality, you would want to consider a Virtual or Dedicated Server
plan. "*

Thanks a lot for your support, hoping this message will help

curl rules ;-)

2008/7/29 Stephen Pynenburg <spynenburg_at_gmail.com>

> Hey,
> I don't think the QUOTE options are skipped, but I can't seem to find any
> that work. With the code:
>
> <?PHP
> $command = array('ls /');
> $ftp_url = "ftp://ftp.freehostia.com";
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_VERBOSE, 1);
> curl_setopt($ch, CURLOPT_USERPWD, "[user]:[password]");
> curl_setopt($ch, CURLOPT_FTPLISTONLY, 0);
> curl_setopt($ch, CURLOPT_URL, $ftp_url);
> curl_setopt($ch, CURLOPT_POSTQUOTE, $command);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
> $res = curl_exec ($ch);
> echo curl_error($ch);
> curl_close ($ch);
> }
> ?>
>
> I get a directory listing returned, as well as the following error:
> QUOT string not accepted: ls /
>
> As per Daniel's advice, I did poke around in the libcurl docs, but the only
> thing I could find relating to it was for the C binding -
> http://curl.haxx.se/lxr/source/docs/examples/ftpupload.c
>
> If all else fails, I guess you could just use something like
> passthru('curl -Q "DELE filename" ftp://user:pass@host/path')
>
> -Stephen
>
> On Mon, Jul 28, 2008 at 4:07 AM, Gaetano Favoino <
> gaetano.favoino_at_gmail.com> wrote:
>
>> Hi Daniel,
>> I've already tried with various commands but quote commands passed by
>> array are skipped...
>> Can anyone provide a simple working example to delete a file from ftp
>> server with curl?
>>
>> Best regards,
>>
>> On Fri, Jul 25, 2008 at 10:56 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>> > On Fri, 25 Jul 2008, Gaetano Favoino wrote:
>> >
>> >> $comandi_array[] = "\"-dele FNVAC20080716140014.CHK\"";
>> >
>> > "-dele" is not a command that you can send to the server and assume
>> it'll
>> > understand. The system with '-' prefix is what the command line tool
>> uses,
>> > libcurl itself has different setopt options for actions to be done
>> before or
>> > after the transfer. See the libcurl docs for details.
>> >
>> > --
>> >
>> > / daniel.haxx.se
>> > _______________________________________________
>> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>> >
>>
>>
>>
>> --
>> Gaetano Favoino
>> gaetano.favoino_at_gmail.com
>> PGP-FP E97A 062D 359A 5B09 FFE9 4842 EDEF EEF6 4AA3 CAEC
>> :wq
>> _______________________________________________
>> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>>
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>

-- 
Gaetano Favoino
gaetano.favoino_at_gmail.com
PGP-FP E97A 062D 359A 5B09 FFE9 4842 EDEF EEF6 4AA3 CAEC
Please consider the environment before printing this mail note.
:wq

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-09-30