cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multipart Formpost: Strange results

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 21 Apr 2004 07:57:57 +0200 (CEST)

On Tue, 20 Apr 2004, Michael Becker wrote:

> From the examples on curl.haxx.se, I derived this source code:

[...]

> Which produces the following HTTP output:

[...]

> Now my question is: The source code looks as if it would add a third
> MIME-part for "filename" (e.g. "Content-Disposition:form-data;
> name="filename" etc.). Why doesn't it? :-)

I agree with you. It looks like a bug!

> (Besides, I am really stunned that curl seems to detect the "image/jpeg" on
> its own)

libcurl has a (very) limited list of extensions that it sets the content-type
for, unless you specify it yourself.

> Is there any pattern/reason/documentation for this behaviour?

The bug is undocumented, but the content-type part is mentioned in the
curl_formadd.3 man page I think.

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-04-21