问题
I currently have a Rails based site that is hosted on Heroku and allows users to upload personal images and videos. I am currently storing them on S3 with the video encoding being done by Zencoder. So far pretty happy with this however I would like to use a service such as Cloudinary. I have created a demo app that uploads to Cloudinary and am very happy with the way it works but with video this does not seem to be working. I am aware that Cloudinary does not do any encoding and I am not looking for them to do that. I will still use Zencoder but would just like one place to store all of the media files.
Is there anyone that has used this approach or maybe some ideas on a better way to solve this problem?
回答1:
Can you please explain what you meant by "this does not seem to be working"? What issues were you experiencing?
You can upload any file type to Cloudinary, not just images. All non-images files, included video files are handled as 'raw' files. Here's an upload example of a WMV file to your Cloudinary account:
Cloudinary::Uploader.upload("sample_video.wmv", :public_id => "sample_video", :resource_type => :raw)
For delivery, the returned public ID of the upload API call should be used. Here's a URL example , notice the '.../raw/upload...' :
http://res.cloudinary.com/demo/raw/upload/sample_video.wmv
For more information: http://cloudinary.com/blog/using_cloudinary_to_manage_all_your_website_s_assets_in_the_cloud
来源:https://stackoverflow.com/questions/16797546/upload-video-to-cloudinary