Ask A Question

Notifications

You’re not receiving notifications from this thread.

File Uploads in Rails With Shrine Discussion

Request as you build the next few in the series that, if possible, you cover:
1) Direct upload to S3
2) JQuery/Multi-File/Background uploading

Thanks!

Reply

+1

Reply

Yes! They're on my list! Also going to do video uploads with transcoding and taking thumbnails of them.

Reply

Really great video. Thanks Chris!

Can you also cover secure upload/file retrieval together with direct upload to S3 and jquery/multi-file/background uploading (with progress bar)?

Reply

Nice one, Chris. Note Heroku allows you to save temporary files to its filesystem, but the files will be cleared every time the dyno is stopped/restarted. More on that here https://devcenter.heroku.co...

Reply

That is correct! I'll be covering that in the future, this is more just the basic introduction. S3 will be coming shortly.

Reply

Great video! Thanks Chris!)

Reply

You're welcome!

Reply

Great video, thanks. Note that the Shrine Homepage link should be http:// and not https://

Reply

Fixed! 3 minutes. Not too bad response time. 🍻

Reply

what is the difference from the Shrine CarrierWave

Reply

See Shrine for CarrierWave Users for a brief introduction. Other differences include proper direct upload and backgrounding support (see the motivational blog post for explanation of the issues with CarrierWave). There are many more differences/advantages, I started writing about them more in depth on my blog :)

Reply

great video! looking forward to the seeing more of shrine.

Reply

Good point about the migration edits on the first one. I learned that the hard way with my first big development project and I have done it this way ever since.

Reply
Andrew Cockerham Andrew Cockerham

How do you encrypt objects on s3? Paperclip has an option for amazon encryption, does shrine?

Reply

You'd have to look at Shrine's code for that, but if it doesn't support it yet, I'm sure it'd be very easy to add since it appears to simply be an additional header to add to requests. That would be a great open source contribution if it doesn't support it already!

Reply

If you look at the Shrine::Storage::S3 documentation, you'll notice that you can set :upload_options when initializing the storage, and this hash will automatically get forwarded to Aws::S3::Object#put on each upload, and that method supports options :server_side_encryption parameter, and any other :sse_* parameters you need.


Shrine::Storage::S3.new(
upload_options: {server_side_encryption: "AES256", ...},
**options
)

Reply

I found a error in this video, (i don't know it's ok ) but, when you make an update in one picture, the old picture does not disappear in Amazon s3

Reply

This episode was extremely helpful in getting Shrine up and running. I found the documentation to be less than clear, and this really helped.. Thank you!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.