Skip to content

Commit 3cb3c8e

Browse files
committed
Revert "Fixed allowed memory size exhausted error"
This reverts commit 1230186.
1 parent 1230186 commit 3cb3c8e

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

resources/views/panel/backups.blade.php

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,24 @@
22

33
@section('content')
44
@if (file_exists(base_path('backups/updater-backups/')) and is_dir(base_path('backups/updater-backups/')))
5-
<?php
6-
$filename = $_SERVER['QUERY_STRING'];
7-
$filepath = base_path('backups/updater-backups/') . $filename;
8-
9-
if (file_exists($filepath)) {
10-
header("Content-type: application/octet-stream");
11-
header('Content-Disposition: attachment; filename="' . $filename . '"');
12-
header('Content-Length: ' . filesize($filepath));
13-
14-
$file = fopen($filepath, 'rb');
15-
if ($file) {
16-
while (!feof($file)) {
17-
echo fread($file, 8192);
18-
ob_flush();
19-
flush();
20-
}
21-
fclose($file);
5+
<?php
6+
$filename = $_SERVER['QUERY_STRING'];
7+
8+
$filepath = base_path('backups/updater-backups/') . $filename;
9+
10+
$strFile = file_get_contents($filepath);
11+
12+
header("Content-type: application/force-download");
13+
header('Content-Disposition: attachment; filename="'.$filename.'"');
14+
15+
header('Content-Length: ' . filesize($filepath));
16+
echo $strFile;
17+
while (ob_get_level()) {
18+
ob_end_clean();
2219
}
23-
exit;
24-
} else {
25-
echo 'File not found.';
26-
}
27-
?>
20+
readfile($filepath);
21+
exit;
22+
?>
2823
@endif
2924

3025
@endsection

0 commit comments

Comments
 (0)