curl-library
Re: FTP, mkdir and escaping invalid characters
Date: Mon, 25 Jan 2010 19:51:24 +0100 (CET)
On Mon, 25 Jan 2010, Nick Jensen wrote:
> I am using libcurl to create directories on a FTP server by using
> CURLOPT_QUOTE and sending a list of MKD commands. Everything works fine, but
> my quote commands fail if the directory name has an invalid character in it
> such as a space or a symbol. Does curl have an escape function for this. I
> noticed there is curl_easy_escape() which will URL encode a string but that
> isn't what I need here.
FTP doesn't say anything about "invalid characters". A "pathname" can consist
of a range of characters where each character is "any of the 128 ASCII
characters except <CR> and <LF>".
Thus, ':' and ' ' (space) are both perfectly legitimate characters in a path
name when given as argument to a FTP command.
Server implementations of various kinds may disagree though, and I am aware
that some servers require escaped spaces for them to work (like '\ ') and some
I believe support them quoted ("file name with spaces"). But that's beyond
what the spec says and AFAIK, there is not even a "common" or "well
established" pratice in that area.
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2010-01-25