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

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.CreateText("C:\Inetpub\wwwroot\VolunteerMatc h\tempstore.txt")
oWrite.WriteLine(Request.Form("mycheckboxgroup"))
oWrite.Close()

but in the end, it shows the error like this
Exception Details: System.UnauthorizedAccessException: Access to the path
"C:\Inetpub\wwwroot\VolunteerMatch\tempstore.t xt" 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}\ASPNET 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="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) 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 2125
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.CreateText("C:\Inetpub\wwwroot\VolunteerMatc h\tempstore.txt")
oWrite.WriteLine(Request.Form("mycheckboxgroup"))
oWrite.Close()

but in the end, it shows the error like this
Exception Details: System.UnauthorizedAccessException: Access to the path
"C:\Inetpub\wwwroot\VolunteerMatch\tempstore.t xt" 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}\ASPNET 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="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) 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
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
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...
3
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"...
1
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...
0
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"...
6
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...
10
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
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...
66
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.