Jump to content
Sign in to follow this  
jane

<img src="E:\My Documents\My Pictures\IMG_1575.JPG" width="300" height="200" /> not working.

Recommended Posts

The image file IMG_1575.jpg is shown properly if I include it using <img src="IMG_1575.jpg" width="300 height="200" />. But if I include it with <img src="E:\My Documents\My Pictures\IMG_1575.JPG" width="300" height="200" />, the image is not shown in the browser. It's blank. How to resolve this? How to include a file on my local computer with direct path?Any input is GREATLY appreciated.

Share this post


Link to post
Share on other sites

If this is going to be part of a public page, then this is not possible. You must upload the image to your directory to let others be able to view it.Else, if the page is only for you privatly, then put a "protocol" in front:<img src="file:///E:\My Documents\My Pictures\IMG_1575.JPG" width="300" height="200" />

Share this post


Link to post
Share on other sites

One problem that I have come across is when adding a path to somewhere if you use \ it will only show the picture in IE, you made need to replace them with / that might make it work?It is apparently a bug in IE which lets you use \'s but if you check you code on the vaildater Here it will tell you to replace them I think.

Share this post


Link to post
Share on other sites

Thank you very much for all the above replies. Now, I used the <img src="file:///E:/My Documents/My Pictures/2006_04_21/IMG_1575.JPG" width="300" height="200" />the picture is still not shown.The page is not online, it's only on my local computer.

Share this post


Link to post
Share on other sites

I think you should search for the problem elseways because this file:/// did work for me. Maybe is it the browser you are using?

Share this post


Link to post
Share on other sites

Thank you very much.With file:\\\ or without still cannot make the image show up on the browser. I checked on both firefox 1.5.0.6 broswer and IE 7.0.5450.4. Usually I only use firefox since it's faster.

Share this post


Link to post
Share on other sites

Then use only slashes: /file:///E:/something/something/something/something.jpgAlso: you do open this local file from your computer and not from an online page (like with a link), don't you?

Share this post


Link to post
Share on other sites

Oh, but that is virtually the same as online. You don't open it from your computer, but still from the internet by using "localhost". It is a virtual server, on your machine privatly. But it still is internet, though only for you. If you open the file just by clicking the .html file, then it would work. Try it :)The way you do it is the same as online even it only counts for your machine only. To open a file from your machine is meant from the file access and not via an URL :) Correct it by "uploading" the file to the directory on your machine that is under your virtual host.

Share this post


Link to post
Share on other sites

Try changing the spaces in the filename to %20. <img src="file:///E:/My%20Documents...You can always just go to File -> Open, open the image, and see what the address is.

Share this post


Link to post
Share on other sites
Try changing the spaces in the filename to %20. <img src="file:///E:/My%20Documents...
I thought about that, but it doesn't matter, with spaces it also worked in my browser (IE) :) Don't know in others, but still. It is just the fact that this document was, in the eyes of the machine, to be found on internet instead of the machine itself. And then it is not allowed to access the harddrive(s) :)

Share this post


Link to post
Share on other sites

The %20 does not work. Yes. If I put the image file to the same directory as my html file under my virtual host, the image is shown properly. Now I am clear!!! When I opened the html file through open->file->browse, I can see the image even if it's just <img src="E:\directory\file.html">. That's why I always saw the picture when I first learned html. Then I began to learn php. I installed php, apache, mysql on my machine. Today, I wanted to incorporate my previous html file with php to make it more dynamic. But this time, I opened the file through http:\\localhost\file.html, but I could not see the image.So when I opened the http:\\localhost\file.html, I actually accessed it through online, although only I can access the file. So in this way, I cannot use <img src="E:\directory\file.html">. Instead, I should upload the file to the directory under my virtual host.Thank you so much for your help.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...