Answer the question
In order to leave comments, you need to log in
Public access to a file?
Hello everyone , the
problem is the following: I save avatars in storage / app / user_files
when I insert a link to an image into the template, only the one who loaded it sees
in config / filesystems.php there is a line
'links' => [
public_path('storage/user_files') => storage_path('app/public/user_files'),
],
Answer the question
In order to leave comments, you need to log in
The bottom line is that the user has access only to the public folder.
If these files can watch everything, store them in public or make a system link to them (That's what you want to do) if not, then behind the public folder. In this case, issue the file not through the server, but by yourself, through php. (Make a Controller that will give the given file and check if the user can see them).
Laravel makes a link to your folder in the public folder, so the user can open them.
Check the Url address and if the link to the file in the public folder is correct
https://laravel.com/docs/8.x/filesystem#the-public-disk
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question