crazyboybert
Programmer
Hi All
Ok, my application lets users browse a directory of files on the server and select files to add to the system (write to a specific storage client and the database). When the user selcts a file it is copied into a directory which temporarily stores the file(s) to be added until the user commits. The user can choose to remove files from those already selected on a subsequent postback. Problem is when ASPNET tries to delete the copy of the file from the temporary storage directory it throws the old "Access the the path ... is denied".
Before anyone asks, yes, ASPNET has full control on both the folders in question with inheritable permissions set to propogate.
There is something odd going on though. The users canalso upload files from their local machine to the server from the same form and these are also stored in the same temporary directory. Yet when one of these is deleted there is no problem.
Code to copy and delete is:
The file defintitely exists and isnt locked by IIS or such like either. Scratching me head on this one. Anybody got any ideas?
Cheers
Rob
i'm a boy, called Bert, and I may not be crazy, but if i'm not the rest of you are...
Ok, my application lets users browse a directory of files on the server and select files to add to the system (write to a specific storage client and the database). When the user selcts a file it is copied into a directory which temporarily stores the file(s) to be added until the user commits. The user can choose to remove files from those already selected on a subsequent postback. Problem is when ASPNET tries to delete the copy of the file from the temporary storage directory it throws the old "Access the the path ... is denied".
Before anyone asks, yes, ASPNET has full control on both the folders in question with inheritable permissions set to propogate.
There is something odd going on though. The users canalso upload files from their local machine to the server from the same form and these are also stored in the same temporary directory. Yet when one of these is deleted there is no problem.
Code to copy and delete is:
Code:
System.File.IO.Copy(source, destination);
and
System.File.IO.Delete(destination);
Cheers
Rob
i'm a boy, called Bert, and I may not be crazy, but if i'm not the rest of you are...