Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Direct Upload to youtube

Reply
 
Old 06-14-2008   #1 (permalink)
TomWA007


 
 

Direct Upload to youtube

I am attempting to do a direct upload to youtube using server side
vbscript. I need to transmit the video with the following headers/
format. You can see this documentation at
http://code.google.com/apis/youtube/...ad_API_Request

POST /feeds/api/users/default/uploads HTTP/1.1
Host: uploads.gdata.youtube.com
Authorization: AuthSub token="<authentication_token>"
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 get the file using the adodb.stream object and can transmit using
the msxml2.serverxmlhttp object. All the headers for the post are easy
enough, but once I get down to the part where it starts --
<boundary_string> with some other non-binary information with the
<Binary File Data> embedded in the middle I have no idea how I can
accomplish this. My original thought was to do this as part of the
"send", but the send only accepts one paramenter and I can't join
binary and non-binary data into a variable to transmit.


So my Original idea was this:

Set objXMLDoc = CreateObject("Msxml2.ServerXMLHTTP.4.0")
objXMLDOC.setTimeouts toResolve, toConnect, toSend, toReceive
objXMLDOC.open "POST", FileUploadAddress, False
objXMLDOC.setRequestHeader "Host", "uploads.gdata.youtube.com"
objXMLDOC.setRequestHeader "Authorization", "GoogleLogin " & AuthToken
objXMLDOC.setRequestHeader "X-GData-Client", "ytapi-..."
objXMLDOC.setRequestHeader "X-GData-Key", "key=AI39si7r..."
objXMLDOC.setRequestHeader "Slug", "the_irish_jig.wmv"
objXMLDOC.setRequestHeader "Content-Type", "multipart/related;
boundary=""f93dcbA3"""
objXMLDOC.setRequestHeader "Content-Length", len(DataToSend)
objXMLDOC.setRequestHeader "Connection", "close"
objXMLDoc.send(DataToSend)



If anyone has any suggestions or advice I would really appreciate it.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
YouTube Vista music pictures video
No Youtube Browsers & Mail
youtube Network & Sharing
IE 7 & YouTube Vista General
Youtube and JavaScript and XP Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46