简体   繁体   中英

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.

Files are privates with the default 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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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