0

I have image on my machine that I want to display in img element.

<img class="card-image" src="'file:///C:/Users/.../KITCHEN/imgname.png'"/>

But I get this error:

1 Not allowed to load local resource: file:///C:/Users/.../KITCHEN/imgname.png

Any idea how to fix this issue.

UPDATE: images outside the project folder

4
  • have the image in the same folder as the html and don't call it with file: etc. Commented Jan 21, 2021 at 19:59
  • Why an absolute path? Are your images outside the project folder? Commented Jan 21, 2021 at 19:59
  • @s.kuznetsov yes, it outside of the app folder Commented Jan 21, 2021 at 20:00
  • Could convert it to base64 instead. Commented Jan 21, 2021 at 20:04

1 Answer 1

1

You should not give an exact local path. You can use a relative path. Here is detailed explanation.

https://www.w3schools.com/tags/att_img_src.asp

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.