如何显示位于另一个驱动器中的图像?

I have two drives:

  • C: (where the IIS is located)
  • D: (where all images are located)

What I want to do is to use the images in the other drive and be able to display them in my site in the other drive.

For example, I have an image called "flower.jpg" located in D: (D:/flower.jpg) and I want to use it in my site. I tried something like this (and as I thought, it doesn't work -- and again, the IIS is in C:):

<img src="D:/flower.jpg"></img>

I also tried with file:/ and file:/// and none worked too.

<img src="file:/D:/flower.jpg"></img>

How could I do it?

First of all, you can't use drive letters in your webserver. Everything is served from the root of the webserver (which is C:\inetpub I believe). You webserver only has access to that folder and should only have access to that folder.

If it's a limited space problem you're having, the easiest solution is moving your inetpub folder to you D: drive like so and place the images under that folder.