Write Permission for folder at runtime in .NET

S

Santaji

Hi,
We have an ASP.NET application which needs to write some files on the
disk. For these we need to give ASP.NET user the Write permission for
that particular folder. This is possible from Windows explorer. We
don't want to given permission from Windows Explorer. Is there any way
of giving Write permission for folder through code ? We want to assign
the Write permission for the folder at the installation time. Is it
possible ? Please let us know.

Thanks in advance,
Santaji Garwe
 
G

Guest

Hi Santaji, That should be just fine, if you allow asp.net to write to the
folder with the security tab in windows explorer (and remove any roles you
don't want to be able to write). Anybody wanting to write to the folder while
logged in to windows explorer would have to have logged in under the asp.net
account.

Alternatively you could look at using temorary impersonation (i.e asp.net
temporarily has elevated privaliges) to write to the folder and then revert
back to the asp.net account when you have finished. HTH jd
 
S

Scott Allen

You could call out to CALCS.EXE during the installation to set
permissions.
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top