We have a intranet web app which uses AjaxControlToolkit's FileUpload mechanism to upload files from different branches of our company to the server which is hosted at HQ.
File Upload works fine. However, our problem is with deleting the file from branch computer.
Since its used within our company, we exactly know from which branch the file was uploaded (users have to select their branch from a dropdown before uploading) which allows us to delete the file from the branch after it has been uploaded. That is, say if branch B123 uploaded hello.pdf, we have a sql table mapping of branch to its network share path. It could be something like \\B123FileShare\Uploads
So once file has been uploaded, all we do is File.Delete(\\B123FileShare\Uploads\hello.pdf).
This delete sometimes works, sometimes doesn't because of sharing violation.
I am just wondering if once fileupload control uploads the file, does it still keeps a lock over the file from client machine? Is there a way I can release this lock (if any) before I can delete the file?
Thanks