简体   繁体   中英

Heroku images won't work

I'm having the strangest issue with my Heroku App. None except one of the images I pushed on there loads in production. All I get is a 404 error. They work fine locally. I know it isn't the path because...well, here's a sample of the mlab collection. The no_image_thumb.gif image works just fine, but the other images like HG01522.jpg just return a 404 error.

 { "id": 794, "itemno": "HG01522", "image": "images/prodimg/HG01522.jpg", "name": "FIXED SNAP SHACKLES", "price": 25.25, "dfec": 68.175, "dpec": 95.87327535, "category": "BOATHARDWA", "selected": 0 }, { "id": 795, "itemno": "HG01602", "image": "images/prodimg/no_image_thumb.gif", "name": "SHACKLE LOCKING 316 8MM", "price": 12.3, "dfec": 33.21, "dpec": 46.70262522, "category": "BOATHARDWA", "selected": 0 } 

How can I fix this?

Your images are part of code or they uploaded from your website? If its second one then you are doing it wrong. Heroku re-deploy your app every day and you loose your images. So go for services like aws s3 or cloudinary

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