By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 831 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

Setting file permissions

P: n/a
Does anyone know how to set file permissions via asp.net? I have a page
that allows me to upload files, but I want to be able to set the
permissions on the file after I upload it. Any ideas? Thanks, Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
There is no in-built support for access control entries in 1.x, I believe
it is there in 2.0. Until then you either have to do some messy pinvokes
to the Win32 API, or shell out to cacls.exe with the System.Diagnositcs.Process
class.

Some resources:

http://west-wind.com/weblog/posts/1040.aspx
http://weblogs.asp.net/cumpsd/archiv.../08/69403.aspx

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/
Does anyone know how to set file permissions via asp.net? I have a
page that allows me to upload files, but I want to be able to set the
permissions on the file after I upload it. Any ideas? Thanks, Rich

*** Sent via Developersdex http://www.developersdex.com *** Don't just
participate in USENET...get rewarded for it!

Nov 19 '05 #2

P: n/a
Hi Rich,

You'll want to investigate WMI. There's sample VB code here to give you an
idea:

Managing NTFS File Security with WMI

http://www.gotdotnet.com/Community/U...1-d6c3f261a3ec

Ken
Microsoft MVP [ASP.NET]
Toronto
"Rich Rekos" <ri***********@questionmark.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
Does anyone know how to set file permissions via asp.net? I have a page
that allows me to upload files, but I want to be able to set the
permissions on the file after I upload it. Any ideas? Thanks, Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 19 '05 #3

P: n/a
Ok, thanks very much, will take a look.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.