|
 |
aspx_security thread: How to create a new file from an aspx page?
Message #1 by "Deepa G" <deepa_g@d...> on Fri, 4 Oct 2002 12:15:28
|
|
hi all!
I am trying to create a new file and write into it froman aspx page.
But, I am getting the follwing error message.
_____________________________________________________________________
Access to the path "c:\inetpub\wwwroot\pract\cit.xml" is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the
path "c:\inetpub\wwwroot\pract\cit.xml" is denied.
The ASP.NET process is not authorized to access the requested resource.
For security reasons the default ASP.NET process identity is '{machinename}
\ASPNET', which has limited privileges. Consider granting access rights to
the resource to the ASP.NET process identity.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add
the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check
the Write box in the Allow column.
________________________________________________________________________
I know how to handle this error if the file already exists in the
directory. But, in my case, no file exists at first. I am trying to create
a new file. Hence, I cannot add "Machinename\ASPNET" as a user unless I
have the file with me !!!
I am perplexed. Kindly help.
thanx
Deepa.
Message #2 by Chandralal Aruketty Velayudhan <chandralala@g...> on Fri, 4 Oct 2002 16:31:56 +0530
|
|
give full access to that directory for the user "Machinename\ASPNET"
-----Original Message-----
From: Deepa G [mailto:deepa_g@d...]
Sent: Friday, October 04, 2002 5:45 PM
To: ASP .NET Security
Subject: [aspx_security] How to create a new file from an aspx page?
hi all!
I am trying to create a new file and write into it froman aspx page.
But, I am getting the follwing error message.
_____________________________________________________________________
Access to the path "c:\inetpub\wwwroot\pract\cit.xml" is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the
path "c:\inetpub\wwwroot\pract\cit.xml" is denied.
The ASP.NET process is not authorized to access the requested resource.
For security reasons the default ASP.NET process identity is '{machinename}
\ASPNET', which has limited privileges. Consider granting access rights to
the resource to the ASP.NET process identity.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add
the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check
the Write box in the Allow column.
________________________________________________________________________
I know how to handle this error if the file already exists in the
directory. But, in my case, no file exists at first. I am trying to create
a new file. Hence, I cannot add "Machinename\ASPNET" as a user unless I
have the file with me !!!
I am perplexed. Kindly help.
thanx
Deepa.
---
Visual Basic .NET Code Security Handbook
This book provides a practical guide to help you
utilize .NET's code access security system. This
important new feature of the .NET framework allows
you to protect your code from attackers even in
complex distributed computing environments. The
book demonstrates best practices for writing
secure code and the worst practices to avoid.
http://www.wrox.com/ACON11.asp?ISBN=1861007477
Disclaimer: This e-mail message along with any attachments is intended only
for the addressee and may contain confidential and privileged information of
GTL Limited. If the reader of this message is not the intended recipient,
you are notified that any dissemination, distribution or copy of this
communication is strictly prohibited. If you have received this message by
error, please notify us immediately, return the original mail to the sender
and delete the message from your system.
Message #3 by =?iso-8859-1?q?Gert=20De=20Ceuster?= <gert_d_c@y...> on Fri, 4 Oct 2002 12:09:07 +0100 (BST)
|
|
Hi G,
Make a special subdirectory where you will write the
file and set the correct security rights on this
directory (like you'd do on the file). You'll be able
to create new files in this directory.
regards,
Gert.
--- Deepa G <deepa_g@d...> wrote: > hi all!
>
> I am trying to create a new file and write into it
> froman aspx page.
> But, I am getting the follwing error message.
>
_____________________________________________________________________
> Access to the path
> "c:\inetpub\wwwroot\pract\cit.xml" is denied.
> Description: An unhandled exception occurred during
> the execution of the
> current web request. Please review the stack trace
> for more information
> about the error and where it originated in the code.
>
>
> Exception Details:
> System.UnauthorizedAccessException: Access to the
> path "c:\inetpub\wwwroot\pract\cit.xml" is denied.
>
> The ASP.NET process is not authorized to access the
> requested resource.
> For security reasons the default ASP.NET process
> identity is '{machinename}
> \ASPNET', which has limited privileges. Consider
> granting access rights to
> the resource to the ASP.NET process identity.
>
> To grant ASP.NET write access to a file, right-click
> the file in Explorer,
> choose "Properties" and select the Security tab.
> Click "Add" to add
> the "{machinename}\ASPNET" user. Highlight the
> ASP.NET account, and check
> the Write box in the Allow column.
>
________________________________________________________________________
>
> I know how to handle this error if the file already
> exists in the
> directory. But, in my case, no file exists at first.
> I am trying to create
> a new file. Hence, I cannot add "Machinename\ASPNET"
> as a user unless I
> have the file with me !!!
>
> I am perplexed. Kindly help.
>
> thanx
> Deepa.
> ---
> Visual Basic .NET Code Security Handbook
>
> This book provides a practical guide to help you
> utilize .NET's code access security system. This
> important new feature of the .NET framework allows
> you to protect your code from attackers even in
> complex distributed computing environments. The
> book demonstrates best practices for writing
> secure code and the worst practices to avoid.
>
> http://www.wrox.com/ACON11.asp?ISBN=1861007477
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Message #4 by "Deepa G" <deepa_g@d...> on Tue, 8 Oct 2002 05:39:58
|
|
thanx for the solution, I have it working now!!!
Deepa.
|
|
 |