Files become ReadOnly
From: Miro (anonymous_at_discussions.microsoft.com)
Date: 05/17/04
- Next message: Svein Terje Gaup: "Re: Confused"
- Previous message: Ken Schaefer: "Re: Help! HTTP 404 - The resource cannot be found."
- Next in thread: David Coe, MCP: "RE: Files become ReadOnly"
- Reply: David Coe, MCP: "RE: Files become ReadOnly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 17 May 2004 04:06:02 -0700
Hello!
For some strange reasons, some of my files become ReadOnly when I copy them to a subfolder to my ASP.NET application. For each new session I clear the temp folder using this code:
private void ClearTempFolder()
{
//Remove all dwg-files from Temp
String[] dwgFiles = Directory.GetFiles(Server.MapPath(TempPath), "*.dwg");
for (int i=0; i<dwgFiles.Length; i++)
File.Delete(dwgFiles[i]);
}
then the user makes selections on the page and new drawings are copied to the temp folder:
private void CopyDWGFileToTemp()
{
...
if (File.Exists(frompath))
{
File.Copy(frompath, Server.MapPath(topath), true);
}
...
}
Sometimes the ClearTempFolder() function fails with an "Access denied" error. If there are for example four files in the folder, two of them are deleted and the two remaining are ReadOnly, and probably causing the error. Sometimes all files are deleted without problem. This problem seems to occur on Windows 2003 Server only. Any ideas on this one?
develop machine: Win XP, Framework 1.1, IIS 5.1, VS.NET 2003 (C#).
Settings: Anonymous Access (IUSR account) and Windows Authentication are checked in IIS. IUSR has full rights on the Temp-folder
Thanks
Miro
- Next message: Svein Terje Gaup: "Re: Confused"
- Previous message: Ken Schaefer: "Re: Help! HTTP 404 - The resource cannot be found."
- Next in thread: David Coe, MCP: "RE: Files become ReadOnly"
- Reply: David Coe, MCP: "RE: Files become ReadOnly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|