Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Files become ReadOnly

Reply
Thread Tools

Files become ReadOnly

 
 
Miro
Guest
Posts: n/a
 
      05-17-2004
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 Tem
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-folde

Thanks
Miro
 
Reply With Quote
 
 
 
 
David Coe, MCP
Guest
Posts: n/a
 
      05-18-2004
It sounds like you need to declare the FileMode for the file(s) using the FileMode attribute.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Become The master in computer hardware to become successfull shilla Computer Security 1 01-22-2011 06:19 PM
Become The master in computer hardware to become successfull shilla VHDL 0 01-22-2011 04:45 AM
ReadOnly XML Files =?Utf-8?B?UmFlZCBTYXdhbGhh?= ASP .Net 2 11-07-2005 03:35 PM
ASP.NET Readonly panel function with readonly checkbox, readonly radiobutton Jonathan Hyatt ASP .Net Web Controls 1 06-08-2004 07:42 PM
fastest way to load NON-readonly files. chad kline C Programming 0 08-12-2003 01:10 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57