HTML Inserting Images From a Computer Folder?

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Guest
I just learned how to code in html, and im trying to put an image on my website thats in a folder not normally referenced by the program. I can't figure out how to get it to find the image without moving it into the normal folder. The image is in a folder like this:

C:\Users/Admin/Pictures/My Pictures/image.jpg

How do i get the program to find this image, without having to store it in the actual program folder??
 
You need to upload the image to your web host or something like photobucket.com or imageshack.com in order for it to show up on your web page. (if I'm understanding your question right...)
 
First person is right, first you need to get it online. Then you need to know for sure that you are allowed to link from your website to where the photo is uploaded, unless you put it in a folder on your website, of course. Photobucket let's you link from your website.

Suppose you have these (and of course, your website isn't at Photobucket, pretend it's at freewebs.com):

main folder
-- -- home page of website
-- -- banner.gif
-- -- picture folder (called images)
-- -- -- -- home.jpg
-- -- -- -- back.jpg
-- -- webpages folder (called mypages)
-- -- -- -- pets webpage
-- -- -- -- horse.jpg

Photo on Photobucket at (for the sake of argument and ease):
http://photobucket/me_at_pbucket/holidays/view1.jpg

In the pets webpage, you could use these ways of showing the pictures:

<img src="horse.jpg">
<img src="../banner.gif">
<img src="../images/home.jpg">
<img src="/images/back.jpg">

On the home page, it could be:
<img src="banner.gif">
<img src="mypages/horse.gif">
<img src="/images/home.jpg">
<img src="image/home.jpg">

In both pages, you would need to use this to get the Photobucket picture showing:
<img src="http://photobucket/me_at_pbucket/holidays/view1.jpg">
That's because you are going outside of your website to another one. Make sure you use the http://

../ means go up one folder.
/ at the beginning, means start from the top folder. (On a website, this means from the highest up place you can put files.)

Normally, you use relative references. A relative reference tells the webpage where something is, in relation to itself. So ../banner.gif means go up one folder to find this picture.

Avoid using more code than you need to, even though it would work, such as /images/home.jpg instead of images/home.jpg

Always use / and never \

Hope that helps. :-)
 
Back
Top