title: Is it possible to detect whether file actually downloaded
body: <p>Suppose I have a controller action method that returns <code>FileResult</code>. Is it possible to detect whether file was <strong>actually downloaded</strong> completely to the client?</p>
  
  <pre><code>public ActionResult GetFile(int id)
  {
      DownloadInfo data = provider.GetInfo(id);
      this.provider.MarkDownloadStart(id);
  
      return File(Server.MapPath(data.Filename), "application/pdf");
  }
  </code></pre>
  
  <p>I do store information when action is being invoked, but that only means that someone initiated download. It doesn't give me any information on the server whether download completed...</p>
  
  <p>I also set content disposition header so file is supposedly never opened directly in browser but rather browser asks to open/save it. This makes it easier for the client to save the file...</p>
  
  <h2>My thinking</h2>
  
  <p>I suppose it's not possible to directly detect that download has actually taken place. but is it possible to do it some other way as by somehow:</p>
  
  <ol>
  <li>loading a view that</li>
  <li>has an <code>iframe</code> that</li>
  <li>requests a file and</li>
  <li>the main view <em>supervises</em> download on the client because it has access to <code>iframe</code> so it sees whether file has finished downloading or not.</li>
  </ol>
  
  <p>Even though upper scenario may seem feasible, I don't know how to actually do this <em>supervision</em>. Maybe there's some other - better - way of doing this task.</p>
  
  <h2>The main question being</h2>
  
  <p>Is it possible to detect on the server that the client finished file downloading completely and not cancelling it in between download?</p>