Reputation: 37136
I have an image in C:\wamp\www\site\img and i try to display it in a page with this:
<img src="C:\wamp\www\site\img\mypicture.jpg"/>
but it's not working.The file is actually there and if I try to refer to it with a relative path i got the picture
<img src="../img/mypicture.jpg">
where is the error?what am I missing?? thank you again guys!
Upvotes: 40
Views: 202881
Reputation: 41
First open the image in any web browser. Then copy the path and add it as image source location like this :
src="file:///C:/wamp64/www/site/img/mypicture.jpg"
Upvotes: 1
Reputation: 15043
You should be referencing it as localhost
. Like this:
<img src="http:\\localhost\site\img\mypicture.jpg"/>
Upvotes: 18
Reputation: 4347
I think because C would be seen the C drive on the client pc, it wont let you. And if it could do this, it would be a big security hole.
Upvotes: 12