image not displaying when hosted on a sever - laravel

guys am in need of serious help,I have successfully deployed laravel application on a live server. Everything looks great except the fact that I am unable to display the images that are being uploaded to the /public/img folder.

Try One of Them
{{url::to('/') }}/images/logo.png
{{url('/images/logo.type')}}
{{url('/images/myimage.jpg')}}
And Must be checked you image folder have access to get images

Try with using asset like this:
<img src="{{asset('ur_image_link_in_public_dir')}}" alt="ur_title">
For example:
<img src="{{asset('img/logo.png')}}" alt="logo">
The above example will display logo.png from your_domain.com/img/logo.png
Don't use public in ur link, just remove it from ur URL, then it will work finely.

Related

cloudinary images works well with img tag in laravel 8 locally but not on heroku/production -- img displays blank on heroku

I tried displaying uploaded images from cloudinary but it wasn't showing using the below
<img style="width:auto" src="https://res.cloudinary.com/hrwev09ub/image/upload/v1637132013/dnpic_1637127942.png">
before now i tried the img tag above actually worked locally but not through heroku, because on heroku what i could see on checking the code source is the below
<img style="width:auto" src="dnpic_1637127942.png">
i am using Laravel 8 with cloudinary on heroku host -- can someone assist me with way out or refer me to a solution tips please.
I'm Danny and I work on Cloudinary's Developer Support team.
I've not had a lot of experience with deploying to Heroku, so I'm unable to speak on why the src is stripping out the https://res.cloudinary.com/hrwev09ub/image/upload/v1637132013 part, however I do notice that the full image path results in a 404.
Could you please let me know what happens when you try to reference the sample image (https://res.cloudinary.com/hrwev09ub/image/upload/sample.jpg) without specifying style=width:auto?
It may also help to confirm you've followed all the steps on Heroku's documentation about using Cloudinary, available here: https://devcenter.heroku.com/articles/cloudinary
Thanks,
-Danny

Laravel storage image on server is not showing

Hello laravel storage link image is showing perfectly in localhost and when i upload the project to shared hosting images are broken. To show images i have been using this syntax
<img src="/storage/users_image/{{$user->users_image }}"
the above one works great on localhost on shared hosting this images are broken to solve i make storage link but images are broken again on broken images it shows https://www.yuvxyz.com/storage/users_image/xxxy.png
note i have uploaded public and other folders on different folders.
Finally i got the solution from YouTube and it works i have created symlink then it worked here is the PHP file

Image Files Not Showing in Laravel App after Deploying on AWS Beanstalk

I have a Laravel Web Application deployed on AWS Beanstalk. Everything including the database works perfectly except for the image/file display. The logo, images, etc. aren't showing up. This is probably a file path problem. My images and files are stored in the "storage" directory. My path to the files are as such:
<img src="/storage/images/logo.png">
This works locally yet on the AWS server it doesn't. I tried all possible paths but still nothing worked. What am I doing wrong?
Try this one to retrieve the assets from the storage directory.
Storage::disk('local')->url('images/logo.png');
You can use it blade in the following format.
<img src="{{ Storage::disk('local')->url('images/logo.png') }}">
This will give the direct URL to /storage/images/logo.png
Also, you need to run the command:
$php artisan storage:link
Before running this command please check if the storage folder is already there or not inside the public folder if it's there then rename it to storage-bk and run the command.

GET imageRoute 404 (Not Found) on Laravel

I have a Laravel project that I've mainly been working on it's back end, but now I copied the layouts from another project which has two images on the header. This is one of them:
<img class="img-logo" src="imagenes/temp_imgs/logo temporal.png">
The images on my old project are stored on public/imagenes/temp_imgs/, so I created those same folders on my new project and stored the images there. But when I run it I get the following error:
GET http://localhost:8000/competencias/imagenes/temp_imgs/logo%20temporal.png 404 (Not Found)
It seems as if it isn't looking for the images on my public folder but rather on the location of the view (competencias), the view is competencias/crear.blade.php
I don't remember much from the configuration on the old project, I only now I ran npm install on both at creation, so both have bootstrap and vue. But that's al I now, maybe you can help me see if a configuration file on the old project is making the image src point to the public folder, or figuring out what's generating the error.
EDIT:
If I paste one of the files from my old project to my new one the images are shown. If I rename one of the files from my new project and give it a name of a file from my old project the images are also shown! I hope this helps in figuring this thing out.
in laravel 5.4 you will not able to see image as your link
route will lock your every public folder
http://localhost:8000/competencias/imagenes/temp_imgs/logo%20temporal.png
just try to use like that
<img class="img-logo" src="{{ url('imagenes/temp_imgs/logo temporal.png') }}">
or
<img class="img-logo" src="{{ asset('imagenes/temp_imgs/logo temporal.png') }}">
You should use {{ asset('imagenes/temp_imgs/logo temporal.png') }}
For all assets use {{asset(....)}} to solve all problems that maybe appear for you
Hope help you

how can i get some image link from google app engine?

i'm soooo newbie for Google app engine.
i just want to put some testimage.jpg file to my GAE server and want to get some image link
like "http://team-abc.appspot.com/testimage.jpg"
i tried to put my images in folder, and by dev_appserver.py myapp, upload these images with
app.yaml(
url: /images/(.*)
static_files: static/images/\1
upload: static/images/(.*)
)
but doens't work. :(
help me.
how can i do that?
if your image is in the folderstructure static/images/testimage.jpg and you define the url for this static image to be
-url: /images/(.*)
then you should be able to get this image at the url
http://team-abc.appspot.com/images/testimage.jpg
If you are newbie may be you can try this app engine boilerplate where one of its features is get image's links.
Good luck

Resources