Posted on: 5/27/2015 10:24:37 AM | Views : 686

Hello everyone !
 I have a task like this:
In a fileupload control load an excel file Save it on server Update database Make (or not) changes to that excel file. Save it on known location (replace the original file - path is always the same) In most cases everything works very well. But in some cases, when replacing the file I receive an error like "The file is used by another process", but the file is not open by nobody.
My goal now is this: After uploading the file on server, check the file if is in use or not; if is used , do not update the database , nor the excel file and throw an error, else continue running the code.
I found an example here: http://stackoverflow.com/questions/424830/detecting-whether-a-file-is-locked-by-another-process-or ...

Go to the complete details ...