473,788 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pass data to a text file! What this error means?


hi, pls help me slove this problem. i am a newbie in using asp.net and SQL
server 2000 and my problem for now is to pass data to a textfile and i have
fail to do so.

the way i did it was i used a datagrid to display certain data for the user
to choose, as they check the checkbox beside the data, the data shall be
store into a text file. therefore, i wrote this

oWrite = oFile.CreateTex t("C:\Inetpub\w wwroot\Voluntee rMatch\tempstor e.txt")
oWrite.WriteLin e(Request.Form( "mycheckboxgrou p"))
oWrite.Close()

but in the end, it shows the error like this
Exception Details: System.Unauthor izedAccessExcep tion: Access to the path
"C:\Inetpub\www root\VolunteerM atch\tempstore. txt" is denied.

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNE T on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="tr ue"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAM E) or the authenticated request user.

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
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access

i do not really know wat this means, could you please help me solve this
problem? and can u please suggest me how to trigger searching capability?
can i use the data in the text file to trigger search with other database
data, so that certain data can be find out as a search result?

pls help, i need advice~~!!
Nov 19 '05 #1
2 2157
sympatico wrote:
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
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access_


Just grant write access for Network Service to the "VolunteerMatch "
folder. This is not secure, I think.

GK
Nov 19 '05 #2
sympatico wrote:
hi, pls help me slove this problem. i am a newbie in using asp.net and SQL
server 2000 and my problem for now is to pass data to a textfile and i have
fail to do so.

the way i did it was i used a datagrid to display certain data for the user
to choose, as they check the checkbox beside the data, the data shall be
store into a text file. therefore, i wrote this

oWrite = oFile.CreateTex t("C:\Inetpub\w wwroot\Voluntee rMatch\tempstor e.txt")
oWrite.WriteLin e(Request.Form( "mycheckboxgrou p"))
oWrite.Close()

but in the end, it shows the error like this
Exception Details: System.Unauthor izedAccessExcep tion: Access to the path
"C:\Inetpub\www root\VolunteerM atch\tempstore. txt" is denied.

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNE T on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="tr ue"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAM E) or the authenticated request user.

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
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access

i do not really know wat this means, could you please help me solve this
problem? and can u please suggest me how to trigger searching capability?
can i use the data in the text file to trigger search with other database
data, so that certain data can be find out as a search result?

pls help, i need advice~~!!


1) if you didn't already know it, asp.net works on the server,
so will write on the server, not on the client.
2) asp.net runs under it's own account, with very few permissions.
(ASPNET on XP, something like NETWORK_SERVICE on win2003).
this account can't write to the filesystem, unless you
specifically grant write-access on the specific directory
you want to write to.
3) writing to a file is usually not a good choice for a webserver:
what if two (or more) users cause your site to write to that file
at the same time?

what do you mean by "search with other database"?

--
Hans Kesting
Nov 19 '05 #3

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

Similar topics

3
1790
by: Carramba | last post by:
Well no more or less.. just wondering what way is esyes to do that. detail: php performs sertch in db and output should by passed to c++ program. how to aceff that? --
0
2456
by: Matt | last post by:
My problem is to allow ASP to interact with JSP, and I pass JavaScript object in my approach, but I wonder if it will work in network, not just in local machine. For testing purposes, the following are page1.html and page2.html that use Array JavaScript object to pass data back and forth. page1.html is able to transfer data to page2.html, but page2.html has trouble to transfer data back to page1.html.
3
2405
by: brett | last post by:
I need to pass a hard coded value to a JS file: <script language="JavaScript" src="Tracking.js" type="text/javascript"></script> Neither of these methods work: <script language="JavaScript" src="Tracking.js?someid=303" type="text/javascript"></script>
1
2182
by: wtistang | last post by:
I need some suggestions regarding a problem I am facing. I have a web page (asp.net and C#) which containing Chinese characters. In my web.config file I have: <globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" fileEncoding="iso-8859-1" />
0
1336
by: Jon Paal | last post by:
how can I pass conventional html upload form to asp.net page for processing / like : (which currently does not work) <form name="userForm" action="upload.aspx" ENCTYPE="multipart/form-data" method="post" > <input id="uploadedFile" type="file" > <input type="submit" id="upload" value="Upload" > </form>
6
4730
by: kath | last post by:
hi everyone......... I have a task, I have fragmented the task into subtask. I have planned to create a class to each subclass and one parent class to handle the sub tasks. Each subclass are saved in seperate file and all my subclasses and parent class are placed in the same folder. The parent class is subclass of wx.Frame, and subclasses are subclass of wx.Panel. Each subclass will create a GUI for each task..
10
1382
by: JoeP | last post by:
Hi All, I have an HTML which I load as string and send it via MailMessage class. oMailMessage.Body = cHTMLString Before it is sent as e-mail I need to pass the HTM file the user
2
1505
by: ravisuguna | last post by:
Hi, I want to pass the entire contents of a php page into a text area in another php page..The php page fetches some data from the database.I want those data to be displayed in a text area in another php page.Pl guide me php code <?php if(isset($_POST)) {
66
8200
by: happyse27 | last post by:
Hi All, my html code is sno 1) and perl code is sno 2). a) I tried to print $filename and it cant print out the value, only blank was displayed, and the file could not be uploaded. And it didnt display the html after the perl script executed. Using perl 5.1 and apache 2.2.9 version(apache installed and run without any errors and no warning, perl tested fine) b) Also, when i clicked the html code to submit the upload of the...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
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
9969
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...
1
7518
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
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
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
2
3675
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.