cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Setting content type of uploaded file using CURLFORM_CONTENTTYPE

From: Michael Wood <esiotrot_at_gmail.com>
Date: Tue, 12 Oct 2010 12:18:43 +0200

On 12 October 2010 11:58, Michael Wood <esiotrot_at_gmail.com> wrote:
> Hi
>
> I'm using libcurl 7.19.7 on Ubuntu and I'm trying to set the content
> type of an uploaded file using CURLFORM_CONTENTTYPE, but it does not
> appear to be working.
>
> I've tried modifying the example postit2.c to add the content type to
> application/octet-stream, but it still seems to be using text/plain.
> I haven't tried a later version of libcurl yet and I will do that, but
> am I doing something wrong?  I've had a look at the tests in git and I
> don't see any that try to use CURLFORM_CONTENTTYPE.

I've just tried it with version curl-7_21_1-172-gedf9566 (according to
git describe --tags) and the results are the same. Also, I tried
specifying the file name using CURLFORM_FILENAME and that also seemed
to be ignored.

I verified with ldd and strace that it is using the newly compiled libcurl:

open("/tmp/curl/lib/libcurl.so.4", O_RDONLY) = 3

Any suggestions?

Thanks.

-- 
Michael Wood <esiotrot_at_gmail.com>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-10-12