You can just retrieve the file from storage, and send it to the browser.
// check whether they are allowed however you need to, and then
return Storage::download('file.jpg');
I'm revamping an application that stores and display pdf files. When a file is uploaded is store under the storage folder which is not accessible from the browser. That is good. In the old application when an authenticated user wanted to see the file, we made a copy to a temporary folder under the public folder, from where it was uploaded to a . After reading the temporary file was deleted.
Is there another way to do this? I was reading about a function Storage::setVisibility, maybe i thought you can turn the visibility on and off to allow for the browser to read the file. But i don't know if that would work.
Please or to participate in this conversation.