xml save denied

farshad

Well-known member
Joined
May 1, 2003
Messages
109
Location
London
Do you know why I am getting this error please?
Access to the path "c:\inetpub\wwwroot\Farshad\ASP.NET\DSL\ctcUsers.xml" is denied.

It happens when running
doc.Save(strPath & "\ctcUsers.xml")
Thanks
 
Ah yes, Ive had a lot of trouble with this error. If messing with
the user permissions doesnt help, there is another (more
awkward) way that works. It seems that permissions wont let
you overwrite the file if the ASP.NET didnt create it to begin with.

To overcome this, set a breakpoint on the doc.Save line. When
this is reached, delete the original file, then continue the code.
The new file will be saved, and then it can be overwritten by the
app.
 
Sorry, I just need to clarify. Do you mean in ASP.NET we cannot overwrite existing file? Every time before save, we need to delete the original file?
 
No, you only need to do this once for the file. After that, the
ASP.NET app will have the proper permissions to overwrite the
file, since it created the file in the first place.
 
I have the same problem, and I tried it. It doesnt work.

When trying to create a new file it keeps coming back with :

Additional information: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path "c:\inetpub\wwwroot\WitteEzel\xml files\test.xml" is denied.
 
I am running xp pro.
Go to windows explorer.
Tools, folder options. At the very buttom of the list in the view tab make sure the item which says something like simple sharing (recommended) is unchecked.
 
Back
Top