简体   繁体   中英

Rails 5 - Store Active Storage files in the database

We have an existing Rails 5.2.3 project with file uploads implemented in various places. Active Storage is configured to store them on disk in the /storage directory, but there is now a requirement that we store files in a database table instead.

Is it possible to configure Active Storage to store files in a database table? I've had a look through the docs and I can't seem to find anything.

If you really want to do that...

Found this gem for Active Storage.

You can also do it with Refile if you are using postgres as db

I've using another gem . For small files it's working great.

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