473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Setting file permissions

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
3 1524
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting FrontPage extensions 2002 hosted by the company...
1
by: AlunBoyd | last post by:
Quick Question. Is it possiable via a ASP to set (NTFS) permissions on files not on the IIS server? I'm sticking together an ASP to create our new user Home/Profile dir file structure. The...
0
by: Praveen | last post by:
Hello. I am writing some code that accepts a DFS Link and Username and grants that User permissions to the physical directory that the DFS Link corresponds to. I am using the System.Management...
1
by: Bob Sanderson | last post by:
I want to put an Access database back end on a network server so that it can be shared by several users. I plan to use the built-in Access security to set permissions for the database but am...
1
by: CES | last post by:
All, Could someone please point me to a step by step resource on setting up a ..net Web Application on IIS. I'm having a problem setting up IIS to except a new Web Application. I'm deploying...
2
by: Phil Hey | last post by:
I am trying to set permissions on a folder programmatically, and have success fully used the code below for knowledge base article 266461 : How To: Programmatically Set NTFS File System Folder...
10
by: John Salerno | last post by:
I always read about how you need to set certain file permissions (for cgi files, for example), but it's never been clear to me *how* you do this. I know you can run the line chmod 755...
10
by: Sridhar | last post by:
HI, I am having problems setting up a website so that it will be available only inside the domain. We have three servers. One is iis server and second one is internal server and the third one is...
5
by: daokfella | last post by:
I have a custom web.config section similar to the following: <CustomAuthSettings attr1="" attr2=""> <Locations RedirectUrl="Invalid.aspx"> <add Path="test.aspx" Roles="1,2,3" Permissions="4,5,6"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.