nikocraft's avatar

accessing image localy works but not on production server

I deployed an app to heroku. I upload some images and they are placed in public folder. When I try to directly access the image like this: http://frozen-fortress-97791.herokuapp.com/TdueJ2s.jpg

I get Sorry, the page you are looking for could not be found. 1/1 NotFoundHttpException in RouteCollection.php line 161:

When I do the same on localhost like this http://images.dev/5VFjZpH.jpg I get an image back.

What could be wrong on production server? It's running apache2 and it's using same .htaccess that comes with laravel

0 likes
4 replies
Snapey's avatar

and you can see the file in the public folder, and the filename is exactly the right case?

AlexanderWright's avatar

Check the file permissions on the production server. Have you copied the images in when you deployed or did the webserver write them?

nikocraft's avatar

my application created them as part of artisan db:seed, however I have now discovered that heroku does not keep files your application creates, it deletes them either after you deploy or if dyno is restarted, which means it's useless for me now. I wanted to use herokus free option for hosting the application as the demo which I plan to sell. Now there is no point of using heroku since it does not offer persistant storage.

Please or to participate in this conversation.