The files need to be in the storage/app/public folder to use the symlink (or create your own link)
Aug 5, 2018
2
Level 6
How to access uploaded files?
I am trying to allow my users to upload files.
I am using the following code to save the uplaoded file
$file->store('uploads', config('filesystems.default'))
The files are getting uploaded to storage/app/uploads as expected.
But I am unable to access the uploaded files.
In my views I am using the following to show the URL for the attachment
{{ asset('storage/uploads/d4PH5XJ1wU165nN5EQXzDcxBCvgmAn5p1uRGIrCJ.txt') }}
the above code returns the following
http://domain.com/storage/uploads/d4PH5XJ1wU165nN5EQXzDcxBCvgmAn5p1uRGIrCJ.txt
I ran the php artisan storage:link command which created the symbolic link. However, that link returns the following error
NotFoundHttpException in RouteCollection.php line 179:
How can I correctly expose the uploaded file to the public?
Please or to participate in this conversation.