Answer the question
In order to leave comments, you need to log in
How to get working url to uploaded file in Laravel?
I upload images to local according to all the rules (creating a link from 'app/storage/public' to 'public/storage'). Images are loaded there, no problem. I write the addresses of the images to the database, but I can't display the images by their url's. It turns out that the images are in "public/storage/"+filename. But if we issue this link in the src of the img tag, there is no image, and for this link we get only "NotFoundHttpException".
Active Google did not help, stackoverflow too. Tell me, what's the problem? Am I using the wrong url or how can I access these files at all? storage_path does not offer, it gives the full path in the system starting with the drive letter.
Answer the question
In order to leave comments, you need to log in
Check the permissions on the created folder, uploaded files and symbolic link.
Thorsen , I am writing my comment as a separate answer, on your advice)
What's your mess :)
1. storage - needed for data that should not be directly available to the client.
2. public - a folder that is available to the client.
You can of course do it through the link as you did, but it's a bit strange. storage - maybe a google drive as well, how do you make a symlink then?
4. if you made a symlink, then check it like this: img src='storage/filename'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question