.NETGURU
how do you write out a file?
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-io' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Karen Healey
Hi,

I am trying to write out XML data to a file and get an error. Specifically, I have a dataset and I want to write the dataset to a file. Then I want to email the file as an attachment. But when I create the dataset using WriteXml, I get this error:

System.UnauthorizedAccessException: Access to the path "C:\WINDOWS\system32\test1.xml" 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.

Even if I call the file "c:\test1.xml" I still get this error so it has nothing to do with the file name. I understand that the process is not authorized. So I have more of a general question.... how does a web page write a file? Where is the file being written? On the users PC or on the web server? If its the web server, then is there any reason why my process should not have privileges? HOw does one go about setting these privileges? If on the users PC, is there some temp directory I should be using that will always have access?

Please forgive my ignorance... total beginner here!

Thanks,

Karen Healey
Click here to reveal e-mail address
(508) 473-1218
Reply to this message...
 
    
Mitch Denny (VIP)
Hi,

I am trying to write out XML data to a file and get an error. Specifically, I have a dataset and I want to write the dataset to a file. Then I want to email the file as an attacment. But when I create the dataset using WriteXml, I get this error:

System.UnauthorizedAccessException: Access to the path "C:\WINDOWS\system32\test1.xml" is denied.

The ASP.NET process is not authorized to access the requested resource.
�or security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting
�ccess rights to the resource to the ASP.NET process identity.

Even if I call the file "c:\test1.xml" I still get this error so it has
�othing to do with the file name. I understand that the process is
not �uthorized. So I have more of a general question.... how does a
web �age write a file? Where is the file being written? On the users
PC or �n the web server? If its the web server, then is there any
reason why �y process should not have privileges? HOw does one go
about setting �hese privileges? If on the users PC, is there some
temp directory I �hould be using that will always have access?

Please forgive my ignorance... total beginner here!

Thanks,

Karen Healey
Click here to reveal e-mail address
(508) 473-1218
Reply to this message...
 
 
System.UnauthorizedAccessException




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification