Detecting whether a user downloaded a file
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/194579/how-to-detect-when-a-user-has-successfully-finished-downloading-a-file-in-php">How to detect when a user has successfully finished downloading a file in php</a>  </p>
</blockquote>



<p>I was wondering if there is a way to detect whether a user downloaded a file?</p>

<p>I am creating a .docx  file on the server, once the user clicks the 'download' button, and allowing them to download the file as shown below. What I am trying to do is delete the file once the bytes that define the file were sent out to the user. Is this possible?</p>

<pre><code>$objWriter-&gt; save('docxFiles/'.$filename);
echo '&lt;script type="text/javascript"&gt;window.location.href=\'docxFiles/'.$filename.'\'&lt;/script&gt;';
</code></pre>

<p>Many thanks in advance</p>
