cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: FTP: get error message from server

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 26 Apr 2011 09:46:07 +0200 (CEST)

On Mon, 25 Apr 2011, pcworld wrote:

> For some actions I use the CURLOPT_QUOTE option to execute specific
> commands, for example to create a directory. When an error occurs, how can I
> get the error message from the server?
>
> For example the protocol log shows this:
> > MKD /x
> < 550 /x: File exists
> * QUOT command failed with 550
>
> I can use the CURLOPT_ERRORBUFFER option to get the latter message ("QUOT
> command failed with 550"), but how could I get the server generated error
> message like "File exists"?

You can use the HEADERFUNCTION or the DEBUGFUNCTION, but it will require some
level of parsing and understanding in your program of what's being received.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-04-26