469,649 Members | 1,202 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,649 developers. It's quick & easy.

system.IO

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 !


Nov 19 '05 #1
1 1316
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
"abcd" <ab**@abcd.com> wrote in message
news:eX****************@TK2MSFTNGP10.phx.gbl...
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 !

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Terrence | last post: by
2 posts views Thread by Scott | last post: by
5 posts views Thread by laks | last post: by
reply views Thread by NicK chlam via DotNetMonster.com | last post: by
2 posts views Thread by =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.