简体   繁体   English

如何将文件隐私(公共或私有)添加到谷歌云存储文件中,并在 Rails 中使用活动存储?

[英]How to add file privacy(public or private) to google cloud storage files with active storage in rails?

I am adding files to google cloud storage bucket with active storage.我正在使用活动存储将文件添加到谷歌云存储桶。 I don't find any way to specify the file privacy, whether it is private or public and the expiration time, and how to resign the url if it has been expired.我没有找到任何方法来指定文件隐私,是私有的还是公开的以及过期时间,以及如果 url 已过期,如何重新签名。

Files are privates with the default ActiveStorage.文件是默认 ActiveStorage 的私有文件。 If you want to be able to upload some files with public acl (with public url), and others with private acl (with expiring url) you can use some patch I found : https://gist.github.com/dinatih/dbfdfd4e84faac4037448a06c9fdc016如果您希望能够上传一些带有公共 acl(带有公共 url)的文件,以及一些带有私有 acl(带有过期 url)的文件,您可以使用我找到的一些补丁: https : //gist.github.com/dinatih/dbfdfd4e84faac4037448a06c9fdc016

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM