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!
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...
That is correct! I'll be covering that in the future, this is more just the basic introduction. S3 will be coming shortly.
what is the difference from the Shrine CarrierWave
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 :)
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.
How do you encrypt objects on s3? Paperclip has an option for amazon encryption, does shrine?
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!
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
)
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
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!