On Feb 27, 12:17 am, jaw...@hotmail.com wrote:
> Thanks for the reply Alex. I've tried what you have suggested and
> the files themself aren't locked they delete no problem. If i skip
> the deletion of the folder itself everything works ok. I just dont
> want to have a million empty folders after running the site for any
> extended period of time. It's only the folders that seems locked.
> Even if browse to the folder with windows explorer and I select it I
> immediately get an access denied error.
>
> Perhaps there is some type of auditing or health monitoring that is
> being applies to the upload folder? If so is there a way to remove the
> auditing from the upload folder and it's subfolders?
>
> One thing I do know for sure is that its not an NTFS rights thing
> cause it happens even on a fat32 system.
>
> Any thoughts are appreciated.
> Eric
I found the reason.
This is due to File Change Notifications (FCN) and affected the .NET 2
only
http://blogs.msdn.com/toddca/archive...01/499144.aspx
http://www.vikramlakhotia.com/Deleti...ASPnet_20.aspx
So, don't delete directories at the runtime
By the way. If this is not working as expected, why don't you change
the logic? You can have only one initial directory at c:\wwwroot\upload
\tmp\ and use it for all files from all users. To remember what the
user has uploaded you can use either session, or a database, or a
special naming of the files (e.g. article_43_thefilename.jpg). Once a
new permanent folder is created you delete all files from the current
user...