Groups | Blog | Home
all groups > asp.net > december 2004 >

asp.net : Images and ASPNET permissions


Patrick.O.Ige
12/1/2004 9:11:03 PM
Impersonation should work for u
Try seeing through this site carefully at:-
http://www.developmentnow.com/blog/2004/12/impersonation-in-aspnet.html
Let me know if it works for you..
Enjoy!
Patrick


[quoted text, click to view]
Alex
12/1/2004 9:37:34 PM
This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C4D7ED.F80896F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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.=20

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=3D"images" value=3D"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.=20

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().=20

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
------=_NextPart_000_000A_01C4D7ED.F80896F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I have a web application hosted on the =
server's=20
F:\www directory. I have images stored on the file system at E:\Images. =
I have=20
the website shared thru IIS pointing to the F:\www directory. =
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>1.) Should I create a virtual directory =
to share=20
out the images on E:\Images?<BR>2.) Should I just link to my images on =
E:\Images=20
from my webapp using a web.config defined setting of &lt;add =
key=3D"images"=20
value=3D"E:\Images"/&gt; ?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The problem is, when I do step 2, it =
works=20
perfectly on my localhost dev environment. When I then push this site =
out to the=20
webserver, and change my web.config's settings, the images are not =
appearing,=20
even though the source to the images is correct - =
file///E:\Images\image1.jpg.=20
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>If I do step 1, and share out the =
images as a=20
vroot, the images appear, except now I cannot run edit/delete/move =
images using=20
functions like Directory.GetFiles(). </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I am having trouble with this. Option 1 =
fails me=20
b/c I cannot edit/update/rename/move images. Option 2 fails me b/c the =
images=20
will not appear in my website.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What should I do for this scenario? Do =
I have=20
permissions issues? I gave the ASPNET account admin rights, and I still =
cannot=20
call Directory.GetFiles(). Any ideas?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Alex</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT></DIV></BODY></HTML>

------=_NextPart_000_000A_01C4D7ED.F80896F0--
Matt Berther
12/1/2004 10:13:02 PM
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.

--
Matt Berther
http://www.mattberther.com

[quoted text, click to view]

AddThis Social Bookmark Button