Browse Source

Vider les tampons avant le téléchargement et passer en octet-stream comme pour les dumps spip

master
Eric Lupinacci 11 months ago
parent
commit
ad4958ed4d
  1. 10
      action/archive_mf_telecharger.php

10
action/archive_mf_telecharger.php

@ -21,14 +21,20 @@ function action_archive_mf_telecharger() {
exit;
}
// Vider tous les tampons pour ne pas provoquer de Fatal memory exhausted
$level = @ob_get_level();
while ($level--) {
@ob_end_clean();
}
// Telechargement du fichier d'archive
header('Content-Description: File Transfer');
header('Content-type: application/zip');
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($chemin_archive) . '"');
header('Content-Transfer-Encoding: binary');
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Length: ' . filesize($chemin_archive));
readfile($chemin_archive);
}

Loading…
Cancel
Save