cURL / Mailing Lists / curl-library / Single Mail

curl-library

YouTube upload - Message Boundary issue

From: Tanmay Anjaria <tanmay.anjaria_at_gmail.com>
Date: Tue, 13 Jan 2009 10:12:29 +0530

Hello,

Thanks for the inputs regarding the header sending. I went through
HTTPHEADER documents and found the reference to *formadd* which suited me.
and I'm using that now.

There is still one hurdle that I can see for uploading the video file to
YouTube.

Please find below the posts I need to make for video upload.

=================
POST /feeds/api/users/default/uploads HTTP/1.1
Host: uploads.gdata.youtube.com
Authorization: AuthSub token="*<authentication_token>*"
GData-Version: 2
X-GData-Client: *<client_id>*
X-GData-Key: key=*<developer_key>*
Slug: *<video_filename>*
Content-Type: multipart/related; boundary="*<boundary_string>*"
Content-Length: *<content_length>*
Connection: close

--*<boundary_string>*
Content-Type: application/atom+xml; charset=UTF-8

*API_XML_request*
--*<boundary_string>*
Content-Type: *<video_content_type>*
Content-Transfer-Encoding: binary

*<Binary File Data>*
--*<boundary_string>*--
=================

I have posted all of these already. While calling the curl perform, it comes
out with an error saying

*"Invalid repeating query parameteterContent-Type:*"

Clearly, this suggests that as we are using 3 Content-Type header requests,
it is giving an error.
*Does it have to do something with the message boundary?*

Because, as I searched on net, one document said:
*In the case of multiple part messages, in which one or more different sets
of data are combined in a single body, a "multipart" Content-Type field must
appear in the entity's header.*

I think, because the message boundary is not set or not valid, the execution
takes all the 3 content-types posted by me for single data body. Where as
there must be boundary string inserted between all of the 3 content-type
fields so that the execution can understand that these 3 Contetn-Type posts
are for different data bodies.

Can someone please throw some light on *how can we insert message
boundaries?*

Considering the variety of cURL API usage and relevance of the program I'm
developing, I'm thinking of uploading it once it finishes successfully. So
that others can use it for reference.

Thanks & Regards,
Tanmay Anjaria
Received on 2009-01-13