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

后端 未结 2 1093
孤城傲影
孤城傲影 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: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

提交回复
热议问题