0

I am copying a 500MB file in asp.net. Whenever user closes web application in the middle of the copy, the next time i try to copy it again it is throwing me an error "Access to the path is denied". I want to close that process whenever user leaves the webpage in the middle of the copy. One possible way could be closing that process in the Session_End event of the global.asx page. But i dont know how to implement it. Any idea would be greatly appreciated.

File.Copy(SrcPath,DestPath,true);
Mujeeb
  • 83
  • 4
  • 14
  • Session_End is not a safe place to do this since it's not guaranteed to fire. – Icarus Mar 19 '13 at 13:45
  • This question might help you: http://stackoverflow.com/questions/1246899/file-copy-vs-manual-filestream-write-for-copying-file Using manual copy gives you better control over the file copy. – Th0rndike Mar 19 '13 at 13:46

0 Answers0