Please help - weird problem

G

Guest

Hi,
While trying to create new directory i recieve the following error
message:
"System.IO.DirectoryNotFoundException: Could not find a part of the path
"\\premfs16\sites".
The path exists, even when i check the path
with the code: Directory.Exists(...) the result is true.

Here is the code:
http://www.adeo.co.il/test.aspx

Notice that in the line before the code throws exception
i create new file to the same path and no error
occurs - only when trying to create directory
the error appears.

Any idea?
 
E

Eliyahu Goldin

Yoni,

This is a security problem. You need to grant read permission for
\\premfs16\sites to the ASP.NET user.

Eliyahu
 
G

Guest

So how do you explain that the code succeeded creating
a file (which needs to read the same path...) and only
creating a directory failed?
 
E

Eliyahu Goldin

Yoni,

Probably file creating doesn't require read permission but directory
creating does. I don't know exactly how all these permissions work.

Security and permission setting is a complicated matter. You don't really
need to understand fully the theoretical background. For your immediate
problem it's enough to know how other people solved the same problem. If you
wish to investigate - you are welcome to invest your time in that.

Eliyahu
 
G

Guest

The problem is much more sophisticated.
My web site host at shared hosting company.
No hosting company will allow users to have read
permissions on their root directory.
So what you are actually saying is that you can not
open directories on web sites which hosts on shared servers.
Is that correct?
 
E

Eliyahu Goldin

Well, I don't think you need read permissions for the root directory, only
for those under yours. Speak to your host and ask again on security
newsgroups.

Good luck,

Eliyahu
 

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

Top