mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-03-04 11:37:48 +01:00
Fixed allowed memory size exhausted error
This commit is contained in:
parent
c60ceb1ff6
commit
1230186977
@ -4,21 +4,26 @@
|
|||||||
@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;
|
||||||
|
|
||||||
$strFile = file_get_contents($filepath);
|
if (file_exists($filepath)) {
|
||||||
|
header("Content-type: application/octet-stream");
|
||||||
header("Content-type: application/force-download");
|
|
||||||
header('Content-Disposition: attachment; filename="' . $filename . '"');
|
header('Content-Disposition: attachment; filename="' . $filename . '"');
|
||||||
|
|
||||||
header('Content-Length: ' . filesize($filepath));
|
header('Content-Length: ' . filesize($filepath));
|
||||||
echo $strFile;
|
|
||||||
while (ob_get_level()) {
|
$file = fopen($filepath, 'rb');
|
||||||
ob_end_clean();
|
if ($file) {
|
||||||
|
while (!feof($file)) {
|
||||||
|
echo fread($file, 8192);
|
||||||
|
ob_flush();
|
||||||
|
flush();
|
||||||
|
}
|
||||||
|
fclose($file);
|
||||||
}
|
}
|
||||||
readfile($filepath);
|
|
||||||
exit;
|
exit;
|
||||||
|
} else {
|
||||||
|
echo 'File not found.';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user