title: php download files with readfile and then delete problem
body: <p>Hello I use the following script for downloading files with php:</p>
  
  <pre><code>$archive = tempnam("//somepath/mms_1/MMS_SERVICE/","asset");
  $zipobject = new ZipArchive();
  $zipobject-&gt;open($archive, ZIPARCHIVE::CREATE);
  $zipobject-&gt;addFile('somefile', '');
  ......
  $zipobject-&gt;close();
  
  $filesize = filesize($archive);
  
  $timestamp=date('d-m-y_H-i');
  header("Content-type: application/x-zip-compressed");
  header("Content-Disposition: attachment; filename=Assets_$timestamp.zip  ");
  header("Content-Description: Download PHP");
  header("Content-Length: filesize ");
  header("Content-Transfer-Encoding: binary");
  readfile_chunked($archive);
  unlink($archive);
  </code></pre>
  
  <p>The problem is that php do not delete the temp zip file when finish downloading, or when user aborts downloading, or when leave page. It seems that unlink never executes in this cases ignore_user_abort(true); function but this doesnt resolve the problem.
  Any one can suggest a solution for this?</p>