curl-library
Content Type - Message Boundary issue in YouTube upload
Date: Tue, 13 Jan 2009 15:42:07 +0530
Hello,
What I want to know is whether we (the developer) insert the boundary string
manually or not. How does it know where to put the boundaries?
Please go through the mail body below (which I sent earlier) to know the
issue exactly. I've searched on net but couldn't find the answer.
Thanks & Regards,
Tanmay Anjaria
---------- Forwarded message ----------
From: Tanmay Anjaria <tanmay.anjaria_at_gmail.com>
Date: Tue, Jan 13, 2009 at 10:28 AM
Subject: Content Type - Message Boundary issue in YouTube upload
To: libcurl development <curl-library_at_cool.haxx.se>
I should also mention that If I remove any one of the 3 Content-Type header
postings, it gives an error saying the following:
*Content-Type
multipart/form-data;boundary=----------------------------69b30b792cb8 is not
valid.*
where as the boundary se by me is as follows:
*
Content-Type: multipart/related; boundary="f93dcbA3"*
Thanks & Regards,
Tanmay Anjaria
---------- Forwarded message ----------
From: Tanmay Anjaria <tanmay.anjaria_at_gmail.com>
Date: Tue, Jan 13, 2009 at 10:12 AM
Subject: YouTube upload - Message Boundary issue
To: libcurl development <curl-library_at_cool.haxx.se>
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