title: Browser event when downloaded file is saved to disk
body: <p>I have sensitive files to download to users, and each user is permitted to <strong>download</strong> a given file exactly once.  If the download fails, I want to permit the re-download, but not otherwise.</p>
  
  <p>It's not sufficient to rely on logging/processing the file download <strong>request</strong> at the server - I need to know deterministically when the file is complete and in place at the client, since many of my users work in an environment with frequent connectivity drops.</p>
  
  <p>The most straightforward way for this to work would be if the browser exposed a "file saved" event from the Save As... dialog that could be wired to a JavaScript function on the download page (which could post back to the server).  But, intuition suggests there might be security holes if browsers exposed this functionality, as it sneaks somewhat outside the sandbox.  I'm not sure this is even possible.</p>
  
  <p>I <a href="https://stackoverflow.com/questions/315752/fire-javascript-code-when-download-finishes">found</a> <a href="https://stackoverflow.com/questions/1106377/detect-when-browser-receives-file-download">several</a> <a href="https://stackoverflow.com/questions/666468/ie6-detecting-when-the-file-download-popup-is-closed">other</a> <a href="https://stackoverflow.com/questions/371497/http-file-download-with-javascript">questions</a> <a href="https://stackoverflow.com/questions/1926730/tracking-download-completions-from-a-website-cdn">in this area</a>, but nothing about this problem specifically.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>Edit:</strong> I should not have used the word "security" in the original question, sorry for triggering the red herrings.</p>
  
  <p><strong>Edit 2:</strong> My "security" phrasing misled folks into offtopic technical security issues, but both of you confirmed my suspicion that "no, there's no browser support for that."  I'm marking the first commenter with the answer since his first sentence had what I was looking for.  Thanks all.</p>