0

i keep getting 404 image not found when viewing the uploaded image on my project but the image is there. im using laravel's asset() helper to retrieve the image. the url in chrome shows http://127.0.0.1:8000/images/dU8oaVTAwQyTor86jvDtdGKvE7H3MYkHZuUG60gH.png and ive already done php artisan storage:link. any help is greatly appreciated.

  • It may be question of logical paths. Did you try with localhost:8000? please check the APP_URL in your .env file, you should point your browser to that url – Farid Dec 03 '22 at 18:22
  • In addition, if you've linked your storage path, `/images` should reflect an `images` folder under `/storage/app/public/`. Please check if your uploaded png is there. – Farid Dec 03 '22 at 18:25
  • its stored on `/storage/app/public/images/`.And updated the APP_URL to `localhost:8000`. still nothing – kristi tanellari Dec 03 '22 at 18:55

2 Answers2

0

You shouldn't use the asset helper for this, the url generated is wrong. As you use the public storage, the url is supposed to be like this :

http://127.0.0.1:8000/storage/images/dU8oaVTAwQyTor86jvDtdGKvE7H3MYkHZuUG60gH.png
Thibaut
  • 266
  • 3
  • 10
0

but aren't you supposed to access the image through the public folder if you do php artisan storage:link