system.IO

A

abcd

code snippet:-

sFile = x:\test\abcd.mdb

if (System.IO.File.Exists(sFile))
//do something
else
//do something else

my code is failing at Exists function. It does not find the file.

X:\ is a mapped drive. X drive has domain account permissions (like
domain\myLoginaccount). also I am runing my web application with default
security as annonymus user called domain\myLoginaccount

Why the Exsits function does not find the file. Am I missing any permissions
here...whats the best mthod to access the files from another machine thru
asp.net

thanks

cheers !
 
A

Andy Fish

I think there are 2 potential hurdles here:

1. does the account running the web page have privileges to access the
share? Be aware that as well as the IIS user and IIS impersonation, you also
have to consider which user the asp.net worker process is running as. This
is quite a complex subject and I'm afraid my knowledge is limited to the
general concept.

2. does the web app actually have the drive mapped? the web server will not
inherit mapped drives from a terminal session so unless you are mapping the
drive from the web app, I don't tihnk it will be there. I would suggest you
try again with a unc path.

Andy
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top