Luke O'Donnell
Luke O'Donnell

Reputation: 13

Image fails to load on website but loads locally

Here is a link to the website so you can see what is going on - https://odonnelldigital.com/

The site loads with all images on any web browser when I copy the full path locally.

So, the most common errors I keep getting from google seem to be the image file being in the wrong directory. I've tried this multiple times, but no joy.

I'm using HTML, CSS, bootstrap & JS I've hosted on GoDaddy, and I'm using the cPanel. Even the favicon won't load! I've tried changing permissions too on the folder and the images/files themselves.

Any help would be really great! Thanks!

Upvotes: 0

Views: 2612

Answers (3)

Patrick de Jong
Patrick de Jong

Reputation: 75

You are using a reference to a local filepath. This means that the file is on your computer's hard disk. From the internet browser your local hard disk is not reachable.

If you need to share files or access your computer remotely, there are specific protocols and methods available such as file-sharing services, cloud storage, or remote desktop applications that provide secure and controlled access to specific files or your entire computer. These methods typically require authentication and use encryption to ensure the security of your data.

How to solve your issue:

  1. Upload the image to a server/cloud storage
  2. Make sure the files are publicly accessable, for example trough sharelinks
  3. Put the link in the 'src' attribute.

Upvotes: 0

oxytoxinsgrace
oxytoxinsgrace

Reputation: 11

You should check the path to the images in your html code. It is found in the src attribute in the image tags. If you take a look at the command console in chrome's dev tools, it states that your images point towards your C drive, which lives in your local development computer. You should put paths to the images relative to where the html file lives.

Upvotes: 1

doo_doo_fart_man
doo_doo_fart_man

Reputation: 404

Problem: Your problem is because you are trying to load a local file on your computer. enter image description here

And since it is locally stored, other users on the web can't access it.

Solution: Upload the image files, the favicon, and other files to your web server and change the src attribute to the file on your site.

Upvotes: 2

Related Questions