473,394 Members | 1,889 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,394 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 2903
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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...

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.