【问题标题】:How to add file privacy(public or private) to google cloud storage files with active storage in rails?如何将文件隐私(公共或私有)添加到带有活动存储在 Rails 中的谷歌云存储文件?
【发布时间】:2019-01-25 09:41:34
【问题描述】:

我正在向具有活动存储空间的谷歌云存储桶添加文件。我没有找到任何方法来指定文件隐私,无论是私有还是公共以及到期时间,以及如果它已过期如何退出 url。

【问题讨论】:

    标签: ruby-on-rails google-cloud-platform google-cloud-storage rails-activestorage ruby-on-rails-5.2


    【解决方案1】:

    文件是私有的,具有默认的 ActiveStorage。如果您希望能够上传一些带有公共 acl(带有公共 url)的文件,而其他带有私有 acl(带有过期 url)的文件,您可以使用我找到的一些补丁:https://gist.github.com/dinatih/dbfdfd4e84faac4037448a06c9fdc016

    https://github.com/rails/rails/issues/31419#issuecomment-370900013

    【讨论】:

      猜你喜欢
      • 2017-05-13
      • 2018-12-06
      • 1970-01-01
      • 1970-01-01
      • 2019-01-24
      • 2016-10-06
      • 2022-01-04
      • 2016-10-18
      • 1970-01-01
      相关资源
      最近更新 更多