简体   繁体   中英

Rails ActiveStorage images disappears

Active Storage image attachments disappears after some couple of minutes in production environment. I am able to upload the images, it appears for some minutes then disappears.

In local it says 'Image cannot be displayed because it contains error' and in Google Storage it says like 'The provided token has expired'.

I am using rail 5.2.3 and Ruby 2.6.0.

Seems like you're using a temporary url, try using url_for helper, it should give you a public permanent url.

https://edgeguides.rubyonrails.org/active_storage_overview.html#linking-to-files

Or rails_blob_url for downloading and rails_representation_url for attachment variants.

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