circumventing CreateDirectory() errors

T

Tim Mulholland

What are my options for getting around the issues with
Directory.CreateDirectory() when i'm working on a hosted server where the
hosting company will not allow the ASPNET user to have read/list access to
the root of the drive (as is necessary for Directory.CreateDirectory() to
work, sadly)?

I have heard of a way to use unmanaged code to call _mkdir or something like
that instead, but that's very far from a clean solution.

What options are there?

Thanks in advance,

-Tim
 
S

Steven Cheng[MSFT]

Hi Tim,

As for the problem you mentioned, I think the better means is to contact
the web host to see whether they can help grant the proper access
permission of your app's folder to aspnet process account. Because
creating/modifying folder/file must have the NTFS file access permission,
we haven't any other means to do this task. Also, if it's impossible to
grant the permission to modify the app's root folder, you can also consider
creating a certain sub folder under the app's root folder and ask the
webhost to see whether can provide any particular setting for that sub dir.


Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top