All threads / File uploads in Rails with Shrine Discussion

Ask A Question


You’re not receiving notifications from this thread.

File uploads in Rails with Shrine Discussion

has anyone used Shrine and Backblaze B2 storage?


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: "#{ENV["CREDENTIALS_ENV"]}/cache", **s3_options),
store: "#{ENV["CREDENTIALS_ENV"]}/store", **s3_options),
public_store: true, upload_options: { cache_control: "max-age=15552000" }, prefix: "#{ENV["CREDENTIALS_ENV"]}/public", **s3_options)

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.