remote file access in .net app

A

Amie

Hi,

My .NET application has a script that checks whether an image file on a
remote server exists using File.Exists.
From my localhost (Server A), I can access the image file via network
path (\\servername\foldername\image.jpg) or virtual directory
(../foldername/image.jpg) within my application.

When I moved the app to a test server (Server B), it still works fine.

However, when the same codebase is run on a pilot server (Server C), it
somehow returns false when File.Exists() is executed. Same target, same
code.

Server A, B, and C are all Windows 2003 and the remote server is
Windows 2000. The target directory has Everyone to have full
permission.

What factors can affect file access on a remote server? I tried playing
with IIS, file system, etc but couldn't figure out.

Let me know if any of you has any suggestion.

Thanks in advance!
 
K

Kevin Frey

I assume \\servername is different to Server A, Server B, and Server C?

As a guess I would examine whether ASP.NET is running under the same user
account of each machine. On our Windows 2003 server I think ASP.NET runs
under the "NETWORK SERVICE" account and I'm not sure whether this can cross
network boundaries at all.

Secondly, you are using a network share \\servername\\foldername to access
the resource. What permissions have been assigned to the network share? I
have found this to be a common gotcha.

Kevin.
 
A

Amie

Hi Kevin,

Thanks for the reply.

Yes, Server A, B, and C are web servers the app is running, and the
target server has images files. Sorry if I wasn't clear previously.

As I specified, "Everyone" has full access to the directory (intranet
network), so figured it wouldn't be necessary to add NETWORK SERVICE--
and they are on different boxes after all. I thought about adding
IUSR_[ServerCMachineName] in the target directory, but shouldn't
"Everyone" cover it all?

Very puzzling thing is it does work from two servers (my localhost and
test server), but just not from our pilot server.. There's gotta be
something different but can't figure out what. [sigh]

If you can think of anything at all, please let me know..! Thank you
again.

Amie
 
A

Amie

It turns out it had to do with IIS setting. The web server that did not
have access to the remote directory was running in IIS 5 isolation
mode. After making it run in IIS 6 native mode, it worked fine.
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top