Revert "Fixed allowed memory size exhausted error"

This reverts commit 1230186977.
This commit is contained in:
Julian Prieber 2023-07-12 15:28:23 +02:00
parent 1230186977
commit 3cb3c8e234
1 changed files with 17 additions and 22 deletions

View File

@ -2,29 +2,24 @@
@section('content') @section('content')
@if (file_exists(base_path('backups/updater-backups/')) and is_dir(base_path('backups/updater-backups/'))) @if (file_exists(base_path('backups/updater-backups/')) and is_dir(base_path('backups/updater-backups/')))
<?php <?php
$filename = $_SERVER['QUERY_STRING']; $filename = $_SERVER['QUERY_STRING'];
$filepath = base_path('backups/updater-backups/') . $filename;
$filepath = base_path('backups/updater-backups/') . $filename;
if (file_exists($filepath)) {
header("Content-type: application/octet-stream"); $strFile = file_get_contents($filepath);
header('Content-Disposition: attachment; filename="' . $filename . '"');
header('Content-Length: ' . filesize($filepath)); header("Content-type: application/force-download");
header('Content-Disposition: attachment; filename="'.$filename.'"');
$file = fopen($filepath, 'rb');
if ($file) { header('Content-Length: ' . filesize($filepath));
while (!feof($file)) { echo $strFile;
echo fread($file, 8192); while (ob_get_level()) {
ob_flush(); ob_end_clean();
flush();
}
fclose($file);
} }
exit; readfile($filepath);
} else { exit;
echo 'File not found.'; ?>
}
?>
@endif @endif
@endsection @endsection