- Known Issues 2
- Bugs 1642
- Feature Requests 1113
- Projects 398
- General Discussion 1290
- Technical Help 964
- Cameras 214
- API 102
This conversation is missing your voice. Take five seconds to join Vimeo or log in.
Please check the
Help page
for general FAQ, video tutorials, and other helpful information
Topic Browser
API 102
-
81. Sorting API Results
2 months ago by David Winstead
-
80. Which API is Used to Change th...
1 month ago by Balaji V
-
79. Return the thumbnail by Video ...
2 months ago by Paulo Rodrigues
-
78. Embed Player JavaScript/Chrome...
4 months ago by Neil Voss
-
77. API Example Stuck in Loop
2 months ago by momo_the_monster
-
76. Change movies on page with jav...
2 months ago by Chris O'Shea
-
75. Argument for password in Priva...
2 months ago by Paul
-
74. Upload API
10 months ago by Ben Novakovic
-
73. vimeo.videos.setPrivacy requir...
2 months ago by myawol
-
72. Desktop auth getToken issues
3 months ago by P.J. Onori
-
71. Upload API Problems
2 months ago by Zach Cowan
-
70. Vimeo Application Authorizatio...
3 months ago by Zach Cowan
-
69. New Feature: Full Info in Vide...
5 months ago by Ted Roden
-
68. Getting Downloads
8 months ago by Robert Katz
-
67. thumbnails without api call
3 months ago by Rhodri Davies
-
66. Frequency limits for commenting?
3 months ago by NitroDesk Inc.
-
65. Embedding Vimeo SWF in applica...
3 months ago by NitroDesk Inc.
-
64. videos.search, page number sup...
3 months ago by NitroDesk Inc.
-
63. Deleting Videos..
3 months ago by NitroDesk Inc.
-
62. Something small for iPhone
6 months ago by Jarques
-
61. How can you generate the .flv ...
4 months ago by R H
- Vimeo: About / Blog / Roadmap / Developers / Forums / Help! / Site Map
- Legal: © 2008 Connected Ventures, LLC. All rights reserved. / Terms & Conditions / Privacy Statement



.
Current
Top
Bottom
I am trying to implement upload via the API in Ruby using the net/http lib. I dont seem to be getting anywhere so I am hoping somebody can offer some assistance to help me figure out where the hurdle is.
Here is the code I have, at the point that this runs I already have logged-in to the website as the user (which has granted athorization to the application), have an auth_token and a ticket_id for the upload.
host = 'www.vimeo.com'
upload_path = '/services/upload'
upload_base_sig = "#{@secret}api_key#{@api_key}ticket_id#{ticket}"
upload_api_sig = Digest::MD5.hexdigest( upload_base_sig )
# Create the POST data, multipart/form format
data = <<"DATA"
--vimeo_upload
Content-Disposition: form-data; name="api_key"
#{@api_key}
--vimeo_upload
Content-Disposition: form-data; name="auth_token"
#{token}
--vimeo_upload
Content-Disposition: form-data; name="api_sig"
#{upload_api_sig}
--vimeo_upload
Content-Disposition: form-data; name="ticket_id"
#{ticket}
--vimeo_upload
Content-Disposition: form-data; name="video"; filename="zach.mpg"
Content-Transfer-Encoding: binary
Content-Type: video/mpg
#{video}
--vimeo_upload--
DATA
headers = {
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, application/x-gsarcade-launch, */*',
'Accept-Language' => 'en-us',
'Host' => 'www.vimeo.com',
'Referer' => "http://www.vimeo.com/",
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)',
'Content-Type' => 'multipart/form-data; boundary="vimeo_upload"',
'Accept-Encoding' => 'gzip, deflate',
'Content-Length' => data.length.to_s,
'Connection' => 'Keep-Alive',
'Cache-Control' => 'no-cache',
'Cookie' => cookies
}
http = Net::HTTP.new( host )
resp, data = http.post( upload_path , data, headers )
puts 'Code: ' resp.code
puts 'Message: ' resp.message
puts 'Data: '
puts data
# It returns code 200 and the message is Ok, but the data passed back doesn't look right, it looks like the binary video content, or at least a chunk of it. I think the problem is in the post data code, but not certain...
Am hoping someone spots a problem for me to address.
Thanks,
Andy
I'll try to replicate it with the code, but if anyone who knows ruby would like to step in... HELP US!