Downloading album : clean and flush before send zip file to avoid 500 error.

This commit is contained in:
Antoine de Roquemaurel 2017-04-18 22:49:19 +02:00
parent 27f207dcba
commit 3037e5c3ac

View File

@ -306,9 +306,14 @@ final class Album {
$zip->close();
// Send zip
header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=\"$zipTitle.zip\"");
header("Content-Length: " . filesize($filename));
header("Content-type: application/zip");
header("Content-disposition: attachment; filename=\"$zipTitle.zip\"");
header("Content-length: " . filesize($filename));
// Clean before, in order to avoid 500 error
ob_end_clean();
flush();
readfile($filename);
// Delete zip
@ -642,4 +647,4 @@ final class Album {
}
?>
?>