cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: libcurl FTP Quote Option

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 2 Apr 2007 22:08:47 +0200 (CEST)

On Mon, 2 Apr 2007, Steve Smith wrote:

> Thanks for the quick reply. What I want to do is issue a 'get' command
> for file transfer (I simplified the example by using 'bin' instead). My
> 'get' failed with results identical to the 'bin' failure (i.e., 502
> Command not implemented)

'get' is not an FTP command just as little as 'bin' is.

And curl already knows how to get a file, no need to do custom commands for
that.

> I figured I was doing something wrong with the quoting

Yes, you keep sending illegal commands. Go read RFC959 first and then come
back and try again.

> Once I can retrieve files via the command line, I need to graduate and
> obtain them programmatically using libcurl.

And why can't you just give curl the proper URL and have it transfer the file?

> Here is the debug output from command curl -v --trace log.txt
> ftp://name:password@123.456.7.89 -Q'cd mem', which also failed in the
> same manner as 'bin' and 'get' (xx entries added by me!).

Yes, since 'cd mem' is yet another failed attempt at sending a valid FTP
command...

> BTW, I have tried all of these commands via the shell command line and all
> worked successfully.

Right, they worked to send to the *FTP CLIENT* but you surely didn't send
those commands to the server. As Dan already explained to you, you can easily
check what the client sent to the server when you used those commands with
your ftp client.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-04-02