Local Storage Upload Laravel 5.3 Hi everyone,
I am new to laravel and want to know about the new feature of upload in 5.3. How can I retrieve an uploaded image from the local storage in to the view in an image tag? Uploaded via this method. $request->file('filename')->store('dir'); Not a base64 file just a normal image or file.
Not what I wanted any way thanks.
@namoos can you explain your requirement then? I thought you wanted to display uploaded image as <img src="images/hello.jps" />
Yes i do. but from the storage directory, because all of my images reside there.
There should already be a link between the storage/public folder and the public
try putting an image in the storage/public folder and access it via a route
like storage/public/test.png then navigate to ´/test.png´ you should be able to see the image
Thanks to all, I really appreciate your help
$prospect = Prospect::find($prospectId);
$attachDocumentOriginalName = $prospect->attach_policy_document_name;
$documentMineType = $prospect->document_mine_type;
$documentUniqueName = $prospect->attach_policy_document;
$headers = [
'Content-Type' => $documentMineType,
'Content-Disposition' => "attachment; filename=" . $attachDocumentOriginalName,
];
if (Storage::exists($documentUniqueName)) {
return Response::make(Storage::disk('local')->get($documentUniqueName), 200, $headers);
} else{
your code
}
Please sign in or create an account to participate in this conversation.