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

icelander's avatar

how to link up storage files

I have ran this command at my terminal

php artisan storage:link

but I still get this errors repeatedly.

The file "C:\xampp\htdocs\fresh\public\storage/images/skoolss_1589826476.pptx" does not exist

this is my controller where I thought I have linked it up

public function download(Slide $slide)
    {
    	return response()->download(public_path("storage/images/{$slide->slide}"));
    }

and my blade file where I call it

<p><a href="{{route('avatar.download',$slide)}}">Download {{ $slide->slide }}</a></p>

I need helpp

0 likes
8 replies
trungtranqn91's avatar

@icelander try this:

public function download(Slide $slide)
    {
    	return response()->download(asset("storage/images/{$slide->slide}"));
    }

guybrush_threepwood's avatar

I don't think php artisan storage:link works in Windows, does it?

You could try creating the symbolic link manually.

Open Command Prompt (not PowerShell) and run:

cd C:\xampp\htdocs\fresh\public\
mklink /D storage ..\storage\app\public
mkshingrakhiya's avatar

This should work

public function download(Slide $slide)
{
    return Storage::download("images/{$slide-slide}");
}

PS: Prefix Storage with \ or import Storage facade.

icelander's avatar

It's still giving me the same error, the file doesn't exist. But the file is in my public/storage/images folder as well as my storage/ app/public/ images folder. What else should I do

mkshingrakhiya's avatar

Did you set the correct permissions to the storage directory? Visit this StackOverflow thread to assign proper permissions to the storage directory and then give it one more try. Also, see what happens when you call Storage::exists("images/{$slide-slide}").

Snapey's avatar

open tinker

>>> $slide = App\Slide::find(1)    // use a slide number you know is correct

>>> public_path("storage/images/{$slide->slide}")

check the PATH that is printed after the second command

Is the file located at that PATH on your file system

Please or to participate in this conversation.