Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

S3 upload form for direct S3 file uploading

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 generators
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
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" %>
<%= file_field_tag :file %>
<%= 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.

Something went wrong with that request. Please try again.