Images and ASPNET permissions

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I have a web application hosted on the server's F:\www directory. I have images stored on the file system at E:\Images. I have the website shared thru IIS pointing to the F:\www directory.

1.) Should I create a virtual directory to share out the images on E:\Images?
2.) Should I just link to my images on E:\Images from my webapp using a web.config defined setting of <add key="images" value="E:\Images"/> ?

The problem is, when I do step 2, it works perfectly on my localhost dev environment. When I then push this site out to the webserver, and change my web.config's settings, the images are not appearing, even though the source to the images is correct - file///E:\Images\image1.jpg.

If I do step 1, and share out the images as a vroot, the images appear, except now I cannot run edit/delete/move images using functions like Directory.GetFiles().

I am having trouble with this. Option 1 fails me b/c I cannot edit/update/rename/move images. Option 2 fails me b/c the images will not appear in my website.

What should I do for this scenario? Do I have permissions issues? I gave the ASPNET account admin rights, and I still cannot call Directory.GetFiles(). Any ideas?

Thanks,

Alex
 
Hello Alex,

The reason why option 2 doesnt work on the web server is because it will
be pushing out image hrefs such as file://e:/images/image1.jpg. Of course,
the client doesnt have this e: drive. :)

Make sure the ASPNET account actually has permissions to e:\images.

On a side note, why wouldnt you have images that the web application requires
underneath the web applications vroot? At that point, you should be able
to do anything you want.
 
Back
Top