简体   繁体   中英

Rails Amazon S3 how to create a File Upload Progress Bar?

How do I create a upload field that uploads the file as soon as it is picked? With a nice status bar on the upload. I am using paperclip for the image uploads with Amazon S3 server. I have see this plugin https://github.com/nathancolgate/s3-swf-upload-plugin but I am not sure how I should use it.

My form:

<%= simple_form_for @photographer, :url => savenew_admin_photographers_path, :html => { :multipart => true, :method => :post} do |f| %>
<%= f.label "Upload image" %><br />
<%= f.input :image, :label => '', :required => true %><br />
<%= f.label "Upload flv" %><br />
<%= f.input :flv, :label => '', :required => true %><br />
<%= f.label "Upload Quicktime"  %><br />
<%= f.input :quicktime, :label => '', :required => true %><br />
<%= f.button :submit, :value => 'Create movie' %>

You should look into JQuery file uploader . I'd recommend this: https://github.com/blueimp/jQuery-File-Upload . Since, I've used it for my Rails application and it worked just out of the box with no configuration and setting issues. Try its Demo: http://blueimp.github.com/jQuery-File-Upload/ before you code. And in last you may also browse some code written for the same in Rails here: https://github.com/ncri/s3_uploader_example

And if you need any kind of help in this. Do let me know cause, I've just finished working on this stuff and have a fresh context about it right now. But I guess you wouldn't need any sort of help if, you're a little hacky in nature.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM