Store image in database using rails paperclip plugin

前端 未结 4 868
南旧
南旧 2021-01-05 15:14

I have an application that uses the Paperclip plugin for image upload. Now that app should get deployed to an host(heroku) which has a read-only file system. Can I somehow t

4条回答
  •  渐次进展
    2021-01-05 15:43

    Check out this sample app

    http://patshaughnessy.net/2009/5/29/paperclip-sample-app-part-3-saving-file-attachments-in-a-database-blob-column

    I guess this is exactly what you need.

    HTH

    PS: storing images in db is usually a bad idea, I am sure you can use paperclip with S3 / cloudfront ( as mentioned in the answers below )

提交回复
热议问题