I am new to the Laravel. I got this project and I don't know why this is not displaying pictures - laravel

Things I tried
1.simple path without URL::to
2.url() method
3.absolute path
4.asset(simple relative path)
in my .env file changed APP_URL from http://localhost to http://localhost:8000 since it runs on 8000 port
I am adding some pictures.
One thing which is important to mention here when i use Simple relative path it shows picture on hovering the mouse in IDE and on browser too but browser does not render it on webpage.
Please see pictures
src="{{URL::to('public/imgs/2.png')}}"

You have to put all your image resource files in public folder then access those resources through the following way:
src="{{ URL::asset('imgs/2.png') }}"

Related

Quasar / Vue.js Image in header not showing

Im really new to Vue.js and Quasar and am currently trying to build just a basic application.
In there i have a header which should display a logo on the top left using the following code in my MainLayout.Vue.
<q-layout view="hHh LpR fFf">
<q-header elevated class="bg-accent text-white">
<q-toolbar>
<q-toolbar-title>
<q-img src= "public/icons/favicon-16x16.png" style="width: 70px;">
</q-img>
Title
</q-toolbar-title>
</q-toolbar>
</q-header>
<q-page-container>
<router-view />
</q-page-container>
</q-layout>
It runs without an error, but the image is not displayed. At its position there is just a blank space. When i open up the JavaScript Console in my Browser,
Failed to load resource: the server responded with a status of 404 (Not Found)
The path is definitely right. Placing the image inside of the src/assets folder did not help as well.
I followed this tutorial, which lead me to the point im at now.
The only difference i can see is that the project in the tutorial uses the "static" folder for its image, however my project does not contain such "static" folder.
Googling i found that the "static" folder got turned into the "public" folder through some update.
But since i'm using the public folder for my code above, this seemingly either is not true or the issue is something else.
So how do i get my logo to be displayed top left in my header?

Images do not display on a static page hosted on AWS S3

In S3, I have an index.html, a CSS file and an images folder with 3 jpg files in it. I cut and pasted the jpgs into the S3 folder. They showed as being there. I set a display policy per the instructions to display to everyone. The page displayed, but the images did not. I get the alt text and the tooltips, but no images. On the page, when I right click the Open Image in New Tab, I get an Access Denied message in XML. The page is: http://s3.amazonaws.com/pittsfordcommunitycenter/index.html
Images display on my development PC. I've tried a lot of things in AWS, including what the documentation suggested. What do I need to change?
This is your index.html URL:
http://s3.amazonaws.com/pittsfordcommunitycenter/index.html
This is your first image URL, which is missing the bucket name:
http://s3.amazonaws.com/images/WheelchairInElevator_w_475.jpg
The image URL should actually be:
http://s3.amazonaws.com/pittsfordcommunitycenter/images/WheelchairInElevator_w_475.jpg
Viewing your page source it looks like, given the location of your index.html file, all your image paths should start with ./images/ instead of ../images/. Since it works on your local machine I'm guessing your local index.html location is different, relative to the image files.
AWS domain links are case sensitive unlike you local machine.
In AWS S3 static Webhosting
../images/WHEELCHAIRINELEVATOR_W_475.JPG is **NOT EQUAL** to
../images/wheelchairinelevator_w_475.jpg

Magento not showing images even if they are in the server

I've installed a Magento theme I bought and since the very first moment it doesn't load images. The weird thing is this:
The site show this:
If I get the url of the first image (Right Click: "Get image url") shows this:
http://ecobiobella.com/media/resized/s/blog/5.jpg
I navigate to this url the images don't exist and I get a 404 error.
The weird thing is that that image is IN MY server and accessible from the server, like this:
As last thing in the root folder public_html I loaded the same image and that gets showed up:
http://ecobiobella.com/5.jpg
I'm not understanding what I'm doing wrong....
Check the media folder for a .htaccess file and remove it.

Localhost is no longer working properly

I just built a site using Xampp and it worked great. I just transferred my site (that I used to develop by updating to live server) to localhost, and it isn't working right at all.
The images do not show and the pages are not refreshing properly.
I had to change the CSS images to /folder/x instead of just x, which I can understand I guess, but why are my HTML images suddenly not working?
One of the pages, the paths are even absolute, but the page just isn't updating even though it's saved in the local folder.
What gives? All I did differently was added a password to root user in MySQL and tried (and failed) at some mod_rewrites, which I removed.
It points the images from localhost/ instead of localhost/folder, even adding folder/x doesn't work.
You probably forgot to convert a link or made a mistake.
Remember that /images/x.png means that it's trying to find the folder images from root and not from the current folder your site is located in. Try using ./images/x.png instead.
Perhaps you could post an example from your site?
Try looking at the Apache access logs and see whether you can find a request for an image with the wrong path.

Images not loaded from js file

I have a javascript plugin that loads some images from the js file itself. I included the js file like that echo '<script src="'.base_url()."js/$js_file.js".'"></script>, the js file loaded correctly but the images not loaded. When i checked the images path from the firebug i found the path relative to the controller http://localhost/mysite/controller/images/nicEditorIcons.gif which the images is the folder that holds my images(its in the root folder).
What is the problem here? and how to let codeigniter load resources correctly?
you should add an slash "/" before any path which is calling a resource to be relative to the root site, first locale your javascript plugin which I think there is where you add the paths to the images that I think looks like images/nicEditorIcons.gif change that to look like /images/nicEditorIcons.gif to be relative to your root path I mean to http://localhost/mysite, so that way it will look like http://localhost/mysite/images/nickEditorIcons.gif instead of the URL you have shown, hope it helps.

Resources