473,761 Members | 9,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\www root\_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 2943
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*****@insigh tbb.com> wrote in message
news:ef******** ******@TK2MSFTN GP10.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\www root\_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.c om> wrote in message
news:%2******** ********@TK2MSF TNGP12.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*****@insigh tbb.com> wrote in message
news:ef******** ******@TK2MSFTN GP10.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\www root\_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*****@insigh tbb.com> wrote in message
news:#y******** ******@tk2msftn gp13.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.c om> wrote in message
news:%2******** ********@TK2MSF TNGP12.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*****@insigh tbb.com> wrote in message
news:ef******** ******@TK2MSFTN GP10.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\www root\_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
14262
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 right corner(toolbar). The SQL Server Service Manager. I tried to search for the sp_helpsrvrolemember command on my drive. It's
1
2459
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/) There is another document indicating it is 10240 in size (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht ml/cpcondefaultsecuritypolicy.asp)
12
2551
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 one is a permission error. The project is a VC++ Web Service. It works fine when the service is hosted on the old W2K dev machine, but on the new XP machine I get a permission error when the service tries to open a text file on the Windows...
2
3688
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 comments from the group: ---microsoft.public.sqlserver.odbc-- subject: Permission Denied -- Thanks for help guys I was able to find a trial version of the Enterprise Manager.
6
9354
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 sure it is a permission issue because the script works when I point the browser directly at the .htm file on the c: drive: c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm
3
582
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. 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...
4
9095
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 required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Permission denied" This is what I am doing. we had an app that...
1
3569
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 permission denied problem. Warning: fopen(/var/www/html/dotproject/files/temp/temp1.pdf): failed to open stream: Permission denied in /var/www/html/dotproject/modules/projects/reports/tasklogs.php on line 307 Could not open file to save PDF. ...
3
12061
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 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (machine.config) ---> System.Security.SecurityException: Request for the permission of type
0
10115
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
9957
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
9775
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
8780
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
7332
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...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3881
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
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.