armancs's avatar

image or document not showing from storage folder

I am trying to show an image from the storage folder it works fine on my local machine but when I uploaded it on the live server image did not show there.

I also created a storage link on the live server don't understand whats the problem.

	                    <img src="{{ asset('storage/'.$userdata->company_logo) }}" class="avatar img-circle img-thumbnail w-50" alt="avatar">

any help will be appreciated thanks in advance.

0 likes
12 replies
Tray2's avatar

If you run ls -ltr in the public directory on your server

Does it show something like this?

/<your project>/storage/app/public

armancs's avatar

@Tray2 yes it's showing.

for me path is //storage/app/public/company-images/

here is all images

Sinnbeck's avatar

Do you have public in the url on production?

armancs's avatar

@Sinnbeck

	   	http://domain.com/storage/company-images/61c545ff00de0-logo.png

when i do like this in console then image showing

		http://domain.com/storage/app/public/company-images/61c545ff00de0-logo.png
Tray2's avatar

@armancs If you do this?

<img src="{{ asset('company-images/('.$userdata->company_logo) }}" class="avatar img-circle img-thumbnail w-50" alt="avatar">

Sinnbeck's avatar

@armancs so if you type in the url it works? What is the url that works and the one that does not?

armancs's avatar

@Tray2 no it won't work because I stored it in a database with that folder name.

armancs's avatar

@sinnbeck sorry for the misunderstanding.

and it's now working. problem solved i deleted the public folder storage link and created the storage link again then its works perfectly now.

thanks all for your help.

Please or to participate in this conversation.