cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Fw: Posting a file with libcurl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 21 Jul 2009 00:07:07 +0200 (CEST)

On Mon, 20 Jul 2009, Patrick Demers wrote:

> i have a c++ project where i post a file using curl_form. When my file
> path contain only non-unicode char, the file post correctly, but when i have
> unicode char in the file path, it does not work. Anyone have an idea of how
> i can post a file with unicode in the filepath ?

libcurl does no particular encoding of the file name but blindly assumes that
it can be put there as 8bit binary. RFC1867 section 3.3 suggests:

    The original local file name may be supplied as well, either as a
    'filename' parameter either of the 'content-disposition: form-data'
    header or in the case of multiple files in a 'content-disposition:
    file' header of the subpart. The client application should make best
    effort to supply the file name; if the file name of the client's
    operating system is not in US-ASCII, the file name might be
    approximated or encoded using the method of RFC 1522.

... but no such encoding is being done currently.

-- 
  / daniel.haxx.se
Received on 2009-07-21