Is there a best directory to place image uploads on heroku?

后端 未结 2 1090
孤城傲影
孤城傲影 2021-01-16 22:45

I\'m using carrierwave and I want to change the directory where images are stored.

Right now the image URL is /uploads/modelname/image/51/nameoffile.jpg

the

相关标签:
2条回答
  • 2021-01-16 23:25

    Heroku doesn't allow uploads to their servers. You need to use another storage medium, like Amazon's S3.

    I'm actually using Parse's (www.parse.com) API to store images on their solution. But it depends how you need access to your images.

    0 讨论(0)
  • 2021-01-16 23:48

    You can upload files to the Heroku dyno filesystems but the filesystem are perishable and not shared among your dynos. Here's a Gist showing how to make Carrierwave store uploaded file in AWS S3 which is a better option: https://gist.github.com/cblunt/1303386

    Here's a Heroku guide for accomplishing this with PaperClip: https://devcenter.heroku.com/articles/paperclip-s3

    0 讨论(0)
提交回复
热议问题