You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Easily generate a form that allows you to upload directly to Amazon S3.
6
6
Multi file uploading supported by jquery-fileupload.
@@ -10,13 +10,13 @@ Code extracted from Ryan Bates' [gallery-jquery-fileupload](https://github.com/r
10
10
## Installation
11
11
Add this line to your application's Gemfile:
12
12
13
-
gem 's3_direct_upload'
13
+
gem 's3-upnow'
14
14
15
15
Then add a new initalizer with your AWS credentials:
16
16
17
-
**config/initializers/s3_direct_upload.rb**
17
+
**config/initializers/s3-upnow.rb**
18
18
```ruby
19
-
S3DirectUpload.config do |c|
19
+
S3UpNow.config do |c|
20
20
c.access_key_id =""# your access key id
21
21
c.secret_access_key =""# your secret access key
22
22
c.bucket =""# your bucket name
@@ -44,12 +44,12 @@ Add the following js and css to your asset pipeline:
44
44
45
45
**application.js.coffee**
46
46
```coffeescript
47
-
#= require s3_direct_upload
47
+
#= require s3-upnow
48
48
```
49
49
50
50
**application.css**
51
51
```css
52
-
//= require s3_direct_upload_progress_bars
52
+
//= require s3-upnow_progress_bars
53
53
```
54
54
55
55
## Usage
@@ -128,15 +128,15 @@ So that javascript code would be executed after the model instance is created, w
128
128
Note: the POST request to the rails app also includes the following parameters `filesize`, `filetype`, `filename` and `filepath`.
129
129
130
130
### Advanced Customizations
131
-
Feel free to override the styling for the progress bars in s3_direct_upload_progress_bars.css, look at the source for inspiration.
131
+
Feel free to override the styling for the progress bars in s3-upnow_progress_bars.css, look at the source for inspiration.
132
132
133
133
Also feel free to write your own js to interface with jquery-file-upload. You might want to do this to do custom validations on the files before it is sent to S3 for example.
134
-
To do this remove `s3_direct_upload` from your application.js and include the necessary jquery-file-upload scripts in your asset pipeline (they are included in this gem automatically):
134
+
To do this remove `s3-upnow` from your application.js and include the necessary jquery-file-upload scripts in your asset pipeline (they are included in this gem automatically):
135
135
```cofeescript
136
136
#= require jquery-fileupload/basic
137
137
#= require jquery-fileupload/vendor/tmpl
138
138
```
139
-
Use the javascript in `s3_direct_upload` as a guide.
139
+
Use the javascript in `s3-upnow` as a guide.
140
140
141
141
142
142
## Options for S3Upload jQuery Plugin
@@ -256,16 +256,16 @@ First, add the fog gem to your `Gemfile` and run `bundle`:
256
256
257
257
Then, run the rake task to delete uploads older than 2 days:
258
258
```
259
-
$ rake s3_direct_upload:clean_remote_uploads
259
+
$ rake s3-upnow:clean_remote_uploads
260
260
Deleted file with key: "uploads/20121210T2139Z_03846cb0329b6a8eba481ec689135701/06 - PCR_RYA014-25.jpg"
261
261
Deleted file with key: "uploads/20121210T2139Z_03846cb0329b6a8eba481ec689135701/05 - PCR_RYA014-24.jpg"
262
262
$
263
263
```
264
264
265
265
Optionally customize the prefix used for cleaning (default is `uploads/#{2.days.ago.strftime('%Y%m%d')}`):
0 commit comments