Image is not display in server but in localhost works fine Image in not shown on sever but in locally, It wokrs perefect.
In this way, I store image
if ($request->has('image')) {
$filename = $request->image->getClientOriginalName();
$request->image->storeAs('avatar/users/', $filename, 'public');
}
Here is in view blade
<img src="{{ asset('/storage/avatar/users/' . auth()->user()->image) }}" >
In locally that works fine but when I upload my project on server, image is not displayed. Can anyone tell me why did it happen? & how to solve it?
To make these files accessible from the web, you should create a symbolic link from public/storage to storage/app/public.
To create the symbolic link, you may use the storage:link Artisan command:
php artisan storage:link
Also make sure the storage folder permission is 755
I run this command & I got this "link already exists." . But still image is not showing
Any console errors like image not found?
yes, console error "404 image not found"
@prince69 What exactly does your "server" look like? Is it a DigitalOcean droplet? Do you even have the permission to write to the filesystem of said server? Did you check inside your storage folder if the file actually exists?
you ran this command on your webserver? (not just locally)
I ran this command locally, then upload it again in server. There is no option to run command in my webserver
Have the same problem -> Image from storage (with symbolic link) works well on local, but not on server.
Displaying a simple pictures from storage is a known bug?
Have anyone managed to solve this?
@AlexandruC Its not a known issue. Its a problem specific to your installation. Please start your own question with your own circumstances.
Please sign in or create an account to participate in this conversation.