【问题标题】:Rails Amazon S3 how to create a File Upload Progress Bar?Rails Amazon S3 如何创建文件上传进度条?
【发布时间】:2011-12-09 04:06:48
【问题描述】:

如何创建一个上传字段,以便在文件被选中后立即上传?上传时带有漂亮的状态栏。我正在使用回形针通过 Amazon S3 服务器上传图像。我看到了这个插件https://github.com/nathancolgate/s3-swf-upload-plugin 但我不确定我应该如何使用它。

我的表格:

<%= 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' %>

【问题讨论】:

    标签: ruby-on-rails ruby ruby-on-rails-3 paperclip simple-form


    【解决方案1】:

    您应该查看 JQuery 文件上传器。我推荐这个:https://github.com/blueimp/jQuery-File-Upload。从那以后,我将它用于我的 Rails 应用程序,它开箱即用,没有配置和设置问题。在你编码之前试试它的演示:http://blueimp.github.com/jQuery-File-Upload/。最后,您还可以在此处浏览在 Rails 中为此编写的一些代码:https://github.com/ncri/s3_uploader_example

    如果您在这方面需要任何帮助。请让我知道原因,我刚刚完成了这些东西的工作并且现在对它有一个新的背景。但我想,如果你天性有点笨拙,你就不需要任何帮助。

    【讨论】:

    • 嘿苏利亚。你能检查我的代码吗?我目前正在使用 jquery 文件上传 + amazon s3。实施 amazon s3 后,我的进度条停止工作。但是,我使用的是 jquery 文件上传的基本版本,而不是完整的 UI。这是我的代码:github.com/EdmundMai/pholderbeta/blob/master/app/views/photos/…
    • 嘿 Edmund,我创建了一个小型 facebook 应用程序,其中包含 omniauth 和 jQuery 文件上传,使用carrierwave,也可以配置亚马逊 S3。这是应用程序存储库的路径:github.com/suryart/faceline
    猜你喜欢
    • 1970-01-01
    • 2023-03-03
    • 2017-12-12
    • 1970-01-01
    • 2013-08-23
    • 2018-09-28
    • 1970-01-01
    • 2011-06-04
    • 1970-01-01
    相关资源
    最近更新 更多