PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, January 19, 2022

[FIXED] Not able to access image stored in Storage folder in Laravel 5.5

 January 19, 2022     laravel, laravel-5.5, php     No comments   

Issue

I am trying to access an image in the url which is stored in the /storage folder.

Image Stored Path:

Project/storage/app/public/default.png

According to Laravel 5.5 docs, your publicly accessible files should be put in directory

storage/app/public

So I did the same, but when I try to access the image as:

http://localhost:8000/storage/default.png

then it doesn't work.

I tried the following command:

php artisan storage:link

but it throws an error:

The "public/storage" directory already exists.


Solution

First use php artisan storage:link

Then you can access all public path using /* like:

http://localhost:8000/default.png

Above command allow you to get images directly from public path!

Hope this helps you!



Answered By - Hiren Gohel
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing