All threads / File uploads in Rails with Shrine Discussion

Ask A Question

Notifications

You’re not receiving notifications from this thread.

File uploads in Rails with Shrine Discussion

has anyone used Shrine and Backblaze B2 storage?

Reply

Can Shrine make files secure? Ideally, selecting which file attachments are secure and which are public should be possible. Currently hard to do with ActiveStorage as you have to select it for all the attachments. Which is quite Basecamp centric in it's thinking.

yes it can

I have mine setup this way

Shrine.storages = {
cache: Shrine::Storage::S3.new(prefix: "#{ENV["CREDENTIALS_ENV"]}/cache", **s3_options),
store: Shrine::Storage::S3.new(prefix: "#{ENV["CREDENTIALS_ENV"]}/store", **s3_options),
public_store: Shrine::Storage::S3.new(public: true, upload_options: { cache_control: "max-age=15552000" }, prefix: "#{ENV["CREDENTIALS_ENV"]}/public", **s3_options)
}

Reply
Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.