471,119 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 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 2764
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Taishi | last post: by
1 post views Thread by Jody Gelowitz | last post: by
12 posts views Thread by Russ | last post: by
2 posts views Thread by Taishi | last post: by
6 posts views Thread by Steve Richter | last post: by
3 posts views Thread by fripper | last post: by

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.