Jagadesha NH
Jagadesha NH

Reputation: 2748

Laravel 5.3 FileNotFoundException

I am uploading an image to local storage as

$path = $request->image->store('images');

Image gets stored in storage/app/images/name.extension

However my problem is showing this image to the user, I am getting file not found exception

I tried, asset, Storage:get, Storage::url and etc.

Any solutions?

Upvotes: 0

Views: 1546

Answers (3)

Jagadesha NH
Jagadesha NH

Reputation: 2748

Mistake was I was storing files in storage/app/images directory instead of storage/app/public/images and finally I retrieved using

asset('storage/'.$image-name)

Upvotes: 0

motia
motia

Reputation: 1999

You can create a symbolic link to the storage/app/images/ from the public directory.

ln -s storage/images public/images

Upvotes: 1

Balraj Allam
Balraj Allam

Reputation: 611

Try this one

Storage::get('/images/'.$filename);

or

Storage::get('/app/images/'.$filename);

Upvotes: 0

Related Questions