473,799 Members | 2,985 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 2544
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.o detocode.com> wrote in message
news:k2******** *************** *********@4ax.c om...
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.o detocode.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
13094
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 new folder, but if the folder exists it deletes the old folder and creates a new one. The error refers to the line where I am deleting the folder. Here is my code: zip_path = "C:\cd_build"
1
6073
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 '800a0046' Permission denied: 'CreateObject'
2
5693
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 exception thrown means we don't have permission to access this folder: bool IsDirectoryAccessible(string path) { try
6
9285
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 privileage by file manager and IIS manager. However, one PC is okay and another PC is not. Any help on this will be greatly appreciated. Regards, --sambuela
3
7966
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 C:\Inetpub\wwwroot\RunReportASP is the directory of my virtual directory for my app. In it's properties I did check "Write" as a permission. What else do I need to do?
2
13190
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 XP SP2 / Access 2003 Private Sub MoveFolder(strDestination As String) 'required references: 'Microsoft Office 11.0 Object Library
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 by the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
3
14059
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 by the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
2
10696
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 not allowed. This is done so that users cannot take away a copy of the .exe file. When I execute the ..exe from the client computer I get .Net Framework Initialization Error, Unable to find a version of the runtime to run this application. The...
0
9540
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10475
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10250
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4139
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 we have to send another system
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.