473,508 Members | 2,357 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Write Permission for folder at runtime in .NET

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

Nov 19 '05 #1
4 2529
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

"Santaji" wrote:
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

Nov 19 '05 #2
You could call out to CALCS.EXE during the installation to set
permissions.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 6 Jul 2005 19:31:36 -0700, "Santaji" <sa*****@gmail.com> wrote:
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


Nov 19 '05 #3
CALCS.EXE or CACLS.EXE ... ?

There's both.

http://msdn.microsoft.com/library/de...SecNetAP02.asp

Just want to make sure of which one it is for this case.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:k2********************************@4ax.com...
You could call out to CALCS.EXE during the installation to set
permissions.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 6 Jul 2005 19:31:36 -0700, "Santaji" <sa*****@gmail.com> wrote:
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

Nov 19 '05 #4
Opps, good catch Juan.

I was thinking of CACLS.exe as in "change ACLs".

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 7 Jul 2005 10:37:47 -0400, "Juan T. Llibre"
<no***********@nowhere.com> wrote:
CALCS.EXE or CACLS.EXE ... ?

There's both.

http://msdn.microsoft.com/library/de...SecNetAP02.asp

Just want to make sure of which one it is for this case.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:k2********************************@4ax.com.. .
You could call out to CALCS.EXE during the installation to set
permissions.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 6 Jul 2005 19:31:36 -0700, "Santaji" <sa*****@gmail.com> wrote:
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


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
13036
by: Katja | last post by:
Dear all, I have a script that creates a FileSystemObject to be used for folder/directory manipulation. What I am trying to do is to search the drive if folder exist. If it doesn't it creates a...
1
6051
by: Klunk | last post by:
Hi, last week I moved the folder of my Intranet application to another disk of the same server. After this change all the ASP page return this error: Microsoft VBScript runtime error...
2
5684
by: Chen Zhuo | last post by:
Hi, I need to write some code to test whether a folder has read/write permission. The idea is to try to read sub-directories in this folder, if succeed, then test whether it's read-only. Any...
6
9147
by: sambuela | last post by:
How can I write message to the file located in the wwwroot directory? It seems that IIS protect these files. Let make me cannot do the I/O writing sucessfully. I try to open file's write...
3
7945
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
2
13150
by: deko | last post by:
Why am I getting: "Error Number 70: Permission denied" when trying to move a folder with the Microsoft Scripting Runtime? Is there some security setting I don't know about? Platform: Windows...
0
789
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
14031
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
2
10672
by: Bill Fallon | last post by:
I have a VS2005 VB.Net windows form application deployed to a share drive. The windows explorer security permissions for this application (.exe) file is set for Everyone with List Folder/Read Data...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
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
7380
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...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.