cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Content Type - Message Boundary issue in YouTube upload

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 14 Jan 2009 08:57:24 +0100 (CET)

On Wed, 14 Jan 2009, Tanmay Anjaria wrote:

Please stop the top-posting. It's contributing to my confusion in this thread.

> *My doubt is:* In spite of setting multipart/related in the HTTP post, why
> does the pcap show Content-Disposition: form-data;

Why doubt? I already explained why those are used.

> char boundary[MAX_PATH]="multipart/mixed; boundary=1a177433f849";
>
> curl_formadd( &formpost, &lastptr,
> CURLFORM_COPYNAME, "Content-Type:",
> CURLFORM_NAMELENGTH, strlen("Content-Type:"),
> CURLFORM_COPYCONTENTS, boundary,
> CURLFORM_CONTENTSLENGTH,strlen(boundary),
> CURLFORM_END );
>
> Is there any mistake in the way I'm setting it?

Yes, as I tried to explain: libcurl doesn't allow you do change the boundary
string. You're passing in the boundary as contents here. Contents named
'Content-Type:' even which is starting to get really confusing...

>> "If the multipart formpost behavior isn't what you like/need/want, you'll
>> need to do it all yourself with the "normal" POST approach."
>
> I think multipart/related will do in my case.

Yes... but libcurl has no particular support for it. Thus: you'll need to do
it all yourself with the "normal" POST approach.

-- 
  Daniel
Received on 2009-01-14