How should I set the directory for images

Hello, I have on the iis server, one folder like “myweb” for all the stuff I need for the website. Then I have two folders, one is called “source” which contains all my source files in asp, flash etc. And another folder called “image” which contains the images I need for the websites.

I wonder in the source folder , what should I write for the image I use on the page so that it find the right one in the image folder and can be shown when I visit it from another pc??

Thanks in advance!

is “myweb” a folder inside the wwwroot folder?

I would normally use absolute paths when building websites (/images/test.gif). This is mainly because when I build sites I’ll have a folder for each section of the site. However in your case where all your files are in the source folder you can probably get away with referencing the images with a reletive path.

So lets say you have a file “services.asp” which is in your “source” folder. You would link to an image in the following way


<img src="../images/imagename.gif">

As long as all the files are in the source folder (and not sub folders within it) that will work fine.

So then when you access it from another PC, the address would be:

http://pcname/myweb/source/services.asp

Is what I am describing the answer you were after? I wasn’t too sure :stuck_out_tongue:

:slight_smile:

Thanks a lot!

you can acutally just forget the "…/"
it could be


<img src="images/imagename.gif">

No, not in this case. The images folder is located outside the folder containing the source code file. Your example requires that the images folder be a subfolder in the same folder as source file.

*Originally posted by Yeldarb *
**you can acutally just forget the “…/”
it could be


<img src="images/imagename.gif">

**