473,225 Members | 1,402 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,225 software developers and data experts.

Permission to Create a File in VB .Net


When testing a VB .Net application on my system (with IIS installed) I get
an error message when using the fileopen function and the file does not
exist ... i.e. I want fileopen to create the file. The message I get is:

* * * * *
Access to the path "c:\inetpub\wwwroot\_private\(filename)" 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.

* * * * *

Now, HELP for the fileopen function says:

" When writing to files, an application may need to create a file if the
file to which it is trying to write does not exist. To do so, it needs
permission for the directory in which the file is to be created."

I do not understand how to give "permission for the directory" to an
application. If the file that fileopen addresses already exists everything
works OK.

Can someone help me understand how to give the appropriate permission such
that any user of the application will be able to create the file (if it
doesn't already exist)?

Thanks very much.

Jul 21 '05 #1
3 2895
All ASP.NET application run under a specific user account. You can do one of
the following:

1) Give this user (ASPNET) the correct access to the folder where you are
trying to create the file.

2) Use impersonation around the code that creates the file to make your
user look like one that does have the access.

Personally for simple things I like #1

"fripper" <fr*****@insightbb.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...

When testing a VB .Net application on my system (with IIS installed) I get
an error message when using the fileopen function and the file does not
exist ... i.e. I want fileopen to create the file. The message I get is:

* * * * *
Access to the path "c:\inetpub\wwwroot\_private\(filename)" 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.

* * * * *

Now, HELP for the fileopen function says:

" When writing to files, an application may need to create a file if the
file to which it is trying to write does not exist. To do so, it needs
permission for the directory in which the file is to be created."

I do not understand how to give "permission for the directory" to an
application. If the file that fileopen addresses already exists everything works OK.

Can someone help me understand how to give the appropriate permission such
that any user of the application will be able to create the file (if it
doesn't already exist)?

Thanks very much.

Jul 21 '05 #2
Thanks very much ... works fine now (used Method 1). I plan to learn about
impersonation now that you bring it up.

"Ray Cassick (home)" <rc************@enterprocity.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
All ASP.NET application run under a specific user account. You can do one of the following:

1) Give this user (ASPNET) the correct access to the folder where you are trying to create the file.

2) Use impersonation around the code that creates the file to make your
user look like one that does have the access.

Personally for simple things I like #1

"fripper" <fr*****@insightbb.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...

When testing a VB .Net application on my system (with IIS installed) I get an error message when using the fileopen function and the file does not
exist ... i.e. I want fileopen to create the file. The message I get is:
* * * * *
Access to the path "c:\inetpub\wwwroot\_private\(filename)" 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.

* * * * *

Now, HELP for the fileopen function says:

" When writing to files, an application may need to create a file if the
file to which it is trying to write does not exist. To do so, it needs
permission for the directory in which the file is to be created."

I do not understand how to give "permission for the directory" to an
application. If the file that fileopen addresses already exists

everything
works OK.

Can someone help me understand how to give the appropriate permission such that any user of the application will be able to create the file (if it
doesn't already exist)?

Thanks very much.


Jul 21 '05 #3
Glad I could help.

"fripper" <fr*****@insightbb.com> wrote in message
news:#y**************@tk2msftngp13.phx.gbl...
Thanks very much ... works fine now (used Method 1). I plan to learn about impersonation now that you bring it up.

"Ray Cassick (home)" <rc************@enterprocity.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
All ASP.NET application run under a specific user account. You can do one
of
the following:

1) Give this user (ASPNET) the correct access to the folder where you

are
trying to create the file.

2) Use impersonation around the code that creates the file to make your user look like one that does have the access.

Personally for simple things I like #1

"fripper" <fr*****@insightbb.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...

When testing a VB .Net application on my system (with IIS installed) I get an error message when using the fileopen function and the file does not exist ... i.e. I want fileopen to create the file. The message I get is:
* * * * *
Access to the path "c:\inetpub\wwwroot\_private\(filename)" 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.

* * * * *

Now, HELP for the fileopen function says:

" When writing to files, an application may need to create a file if the file to which it is trying to write does not exist. To do so, it needs
permission for the directory in which the file is to be created."

I do not understand how to give "permission for the directory" to an
application. If the file that fileopen addresses already exists

everything
works OK.

Can someone help me understand how to give the appropriate permission

such that any user of the application will be able to create the file (if it doesn't already exist)?

Thanks very much.



Jul 21 '05 #4

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

Similar topics

11
by: Taishi | last post by:
Andy, I am new to SQL. It was hard just to figure out how to install it. I know I am logged in as a Admin. in Windows. I have the little server box with the round circle on it in the bottom...
1
by: Jody Gelowitz | last post by:
Exactly what is the size limit of Isolated Storage in the Internet permission set? I have a document indicating it is 10MB (http://msdn.microsoft.com/msdnmag/issues/02/07/NetSmartClients/) ...
12
by: Russ | last post by:
Hello. My new dev machine is running XP Pro. In the past all equipment has only used Windows 2000. I have had a lot of problems getting my projects up and running on the new machine. The current...
2
by: Taishi | last post by:
New user of SQL Everything is on the same machine My error is close to the bottom After reading it today, I can see there is a problem with 2 dbases 'PUBS' and 'Master' There are also some...
6
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty...
3
by: fripper | last post by:
When testing a VB .Net application on my system (with IIS installed) I get an error message when using the fileopen function and the file does not exist ... i.e. I want fileopen to create the file....
4
by: stephen | last post by:
Hi, I am getting an error while trying to create an excel file. "Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the...
1
by: doctorhardik | last post by:
other interesting thing i observe during my work which i describe below: i am using dotproject2.0.4 on fc3. it is working fine. but i want to generate pdf file report during this time i face...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.