You can delete it immediately after downloading. print the contents of the file, then close it and unlink.
Edit : example
$fo = fopen($f, 'rb') ;
$content = fread($fo, filesize($f)) ;
fclose($fo) ;
}
header("Content-Type: application/octet-stream");
header("Content-Length: " . strlen($archive));
header("Content-Disposition: attachment; filename=\"myfile.exe\"");
echo $archive;
unlink($f);
source
share