Laravel 5.6 file not found in storage

3.1k views Asked by At

My Laravel application is about uploading and showing images. It was working good and all images where shown correctly. Now a few weeks later I tried to test it again and it stopped working. Images are in Laravel storage and path is correct but it says: "Failed to load resource: the server responded with a status of 404 (Not Found)".

Path is: http://localhost:8000/storage/images/8/uploaded/1536930406sunflower.png, and it's correct, image is there.

Weird is that it was working for months and now images cannot be found.

Thanks!

2

There are 2 answers

0
Denis2310 On

I have found the solution to my question and for those who have the same problem:

Storage link in public folder can be possibly broken.

1)Delete storage link in app/public folder.

2)Run command php artisan storage:link to create storage link again.

1
Semazen On

Also, you have to be sure about your upload folder name and database image addresses are the same.

Otherwise, it will broke and do not forget that it is case sensitive.Example: If image address is "jpg/photo1.jpg" on DB. Your upload folder in storage folder must be "jpg" not "JPG".