[html] src absolute path problem

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!

This question is related to html image src absolute-path

The answer is


You should be referencing it as localhost. Like this:

<img src="http:\\localhost\site\img\mypicture.jpg"/>


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.


Use forward slashes. See explanation here


<img src="file://C:/wamp/www/site/img/mypicture.jpg"/>


Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to image

Reading images in python Numpy Resize/Rescale Image Convert np.array of type float64 to type uint8 scaling values Extract a page from a pdf as a jpeg How do I stretch an image to fit the whole background (100% height x 100% width) in Flutter? Angular 4 img src is not found How to make a movie out of images in python Load local images in React.js How to install "ifconfig" command in my ubuntu docker image? How do I display local image in markdown?

Examples related to src

OpenCV TypeError: Expected cv::UMat for argument 'src' - What is this? Angular 4 img src is not found Rotate an image in image source in html html script src="" triggering redirection with button What is the right way to write my script 'src' url for a local development environment? How to properly reference local resources in HTML? Dynamically add script tag with src that may include document.write Programmatically change the src of an img tag Get img src with PHP Javascript : get <img> src and set as variable?

Examples related to absolute-path

Server Document Root Path in PHP Do I need to pass the full path of a file in another directory to open()? PHP absolute path to root How to use relative/absolute paths in css URLs? src absolute path problem Relative path to absolute path in C#? Get filename and path from URI from mediastore Convert absolute path into relative path given a current directory using Bash How to get the file-path of the currently executing javascript code Resolve absolute path from relative path and/or file name