public
Description: S3 upload form for direct S3 file uploading
Homepage:
Clone URL: git://github.com/qoobaa/s3_upload_form.git
name age message
file .document Tue Jun 16 04:00:59 -0700 2009 initial import [Jakub Kuźma]
file .gitignore Tue Oct 20 00:53:13 -0700 2009 removed gemspec [qoobaa]
file LICENSE Tue Jun 16 04:00:59 -0700 2009 initial import [Jakub Kuźma]
file README.markdown Mon Aug 03 04:51:35 -0700 2009 refactored form [Jakub Kuźma]
file Rakefile Tue Jun 16 13:42:12 -0700 2009 changed name to s3_upload_form [Jakub]
file VERSION Mon Aug 03 04:51:35 -0700 2009 refactored form [Jakub Kuźma]
directory generators/ Tue Jun 16 13:42:58 -0700 2009 added gemspec [Jakub]
directory lib/ Mon Aug 03 04:51:35 -0700 2009 refactored form [Jakub Kuźma]
directory test/ Wed Jun 17 02:47:27 -0700 2009 fixed range in filesize [Jakub Kuźma]
README.markdown

s3_upload_form

Usage

<% form_tag s3_bucket_url, :multipart => true do -%>

<%= s3_signature_tag :key => "uploads",
                     :redirect => image_processing_url,
                     :acl => "public-read",
                     :max_filesize => 0..5.megabytes,
                     :submit => submit_tag("Upload!") %>
<%= label_tag :file, "File" %>
<br/>
<%= file_field_tag :file %>
<br/>
<%= submit_tag "Upload" %>

<% end -%>

Remember to turn off the request forgery protection in the controller:

class UploadsController < ApplicationController

self.allow_forgery_protection = false

def new
  # ...
end

end

Configuration

To configure s3_upload_form use s3_upload_form generator...

./script/generate s3_upload_form

... and edit the generated initializer file s3_upload_form.rb.

Jakub Kuźma, 2009

The gem is based on D2S3 plugin by Matthew Williams.