-3
<img src="C:\Users\Maxine\Pictures\loveson.jpg">

The image does not appear when incorporate the image location within the source. If I upload an image from the internet, and copy the image source, the image will appear after executing the code.

AsiaNwoye
  • 7
  • 5
  • Possible duplicate of [How to show local picture in web page?](https://stackoverflow.com/questions/4908171/how-to-show-local-picture-in-web-page) – Simon Visser Jun 21 '17 at 12:42
  • Is this for a website you are creating located on your computer, or on a live web server? You dont want to allow people to access your local file system if its on a live site.. – Chris Marsland Jun 21 '17 at 12:46
  • 1
    Possible duplicate of [Why can't I do ?](https://stackoverflow.com/questions/4090712/why-cant-i-do-img-src-c-localfile-jpg) – Turnip Jun 21 '17 at 12:46
  • Before posting your question on stackoverflow try searching for solution on [Google](https://www.google.co.in/). – Mr ASquare Jun 21 '17 at 13:00

3 Answers3

0
<img src="C:/Users/Maxine/Pictures/loveson.jpg">

try this change the slash

Nithin
  • 1,376
  • 12
  • 29
0

If this is for a website you are developing on your computer, then put in in a folder called 'images' relative to the index.html file;

  • FOLDER: myWebsite
    • -SUB FOLDER - images
    • -FILE - index.html

Then use this:

<img src="/images/loveson.jpg">

If this is for a website that is current accessable to the public, then i suuggest uploading the images you wish to use onto the server the website is located and follow the same directions as specified above. You do not want to allow people to access your local files system, bad news.

0

You can access local files ONLY if the whole webpage (the HTML file) is also accessed as a local file. If you uploaded the page to some server or access it via localhost, then it is not possible to access local file directly.

Also, you should use file:// at the beginning of path, however browsers will understand the path even without it: src="file://C:\Users\Maxine\Pictures\loveson.jpg"

Ondra Koupil
  • 1,034
  • 6
  • 9