Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

namoos's avatar

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.

0 likes
9 replies
namoos's avatar

Not what I wanted any way thanks.

popcone's avatar

@namoos can you explain your requirement then? I thought you wanted to display uploaded image as <img src="images/hello.jps" />

namoos's avatar

Yes i do. but from the storage directory, because all of my images reside there.

WebKenth's avatar

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

namoos's avatar

Thanks to all, I really appreciate your help

snaveenrpm's avatar

$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 or to participate in this conversation.