How to allow my Web Application access a network resource?

Q

Q. John Chen

All,

I have an ASP.NET application (with FormAuthentication but it
shouldn't matter because I may allow unauthenticated user also).

I want to read a file on a network drive so user can download the
file.

What is the best way to achieve this?

Thanks

John
 
R

Raterus

well the "best" way could be debated about here....here are most of your options

add this to web.config (look up asp.net impersonation for more details)

<identity impersonate="true" userName="DOMAIN\userwithpermissionstoaccessfile" password="blahblah" />

or you can impersonate via code from this article (look at second option)
http://support.microsoft.com/default.aspx?scid=kb;en-us;306158

or, if IIS runs under a domain account that has permissions you can just do this, and avoid the cleartext password issue

<identity impersonate="true" />

Good luck!
--Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top