mirror of
https://github.com/kleeja-official/kleeja.git
synced 2025-12-16 04:59:42 +01:00
Update DB Schema
This commit is contained in:
47
do.php
47
do.php
@@ -505,7 +505,11 @@ elseif (ig('down') || ig('downf') ||
|
|||||||
|
|
||||||
//send file headers
|
//send file headers
|
||||||
header('Pragma: public');
|
header('Pragma: public');
|
||||||
header('Accept-Ranges: bytes');
|
if ($resuming_on) {
|
||||||
|
header('Accept-Ranges: bytes');
|
||||||
|
} else {
|
||||||
|
header('Accept-Ranges: none');
|
||||||
|
}
|
||||||
header('Content-Description: File Transfer');
|
header('Content-Description: File Transfer');
|
||||||
|
|
||||||
//dirty fix
|
//dirty fix
|
||||||
@@ -528,29 +532,27 @@ elseif (ig('down') || ig('downf') ||
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
//add multipart download and resume support
|
//add multipart download and resume support
|
||||||
if (isset($_SERVER['HTTP_RANGE']))
|
if (isset($_SERVER['HTTP_RANGE']) && $resuming_on)
|
||||||
{
|
{
|
||||||
if ($resuming_on)
|
list($a, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
|
||||||
{
|
list($range) = explode(',', $range, 2);
|
||||||
list($a, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
|
list($range, $range_end) = explode('-', $range, 2);
|
||||||
list($range) = explode(',', $range, 2);
|
$range = round(floatval($range), 0);
|
||||||
list($range, $range_end) = explode('-', $range, 2);
|
$range_end = ! $range_end ? $size - 1 : round(floatval($range_end), 0);
|
||||||
$range = round(floatval($range), 0);
|
|
||||||
$range_end = ! $range_end ? $size - 1 : round(floatval($range_end), 0);
|
if ($range < 0 || $range >= $size || $range > $range_end || $range_end >= $size ) {
|
||||||
|
header('HTTP/1.1 416 Requested Range Not Satisfiable');
|
||||||
$partial_length = $range_end - $range + 1;
|
header("Content-Range: bytes */$size");
|
||||||
header('HTTP/1.1 206 Partial Content');
|
fclose($fp);
|
||||||
header("Content-Length: $partial_length");
|
|
||||||
header("Content-Range: bytes $range-$range_end/$size");
|
|
||||||
|
|
||||||
fseek($fp, $range);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Respond with a 416 Range Not Satisfiable
|
|
||||||
header('HTTP/1.1 416 Range Not Satisfiable');
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$partial_length = $range_end - $range + 1;
|
||||||
|
header('HTTP/1.1 206 Partial Content');
|
||||||
|
header("Content-Length: $partial_length");
|
||||||
|
header("Content-Range: bytes $range-$range_end/$size");
|
||||||
|
|
||||||
|
fseek($fp, $range);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -565,9 +567,6 @@ elseif (ig('down') || ig('downf') ||
|
|||||||
//read and output the file in chunks
|
//read and output the file in chunks
|
||||||
while (! feof($fp) && (! connection_aborted()) && ($bytes_sent < $partial_length))
|
while (! feof($fp) && (! connection_aborted()) && ($bytes_sent < $partial_length))
|
||||||
{
|
{
|
||||||
if ($chunksize > ($partial_length - $bytes_sent)) {
|
|
||||||
$chunksize = $partial_length - $bytes_sent;
|
|
||||||
}
|
|
||||||
$buffer = fread($fp, $chunksize);
|
$buffer = fread($fp, $chunksize);
|
||||||
print($buffer);
|
print($buffer);
|
||||||
flush();
|
flush();
|
||||||
|
|||||||
@@ -35,4 +35,5 @@ $update_schema[9]['sql'] = [
|
|||||||
|
|
||||||
$update_schema[10]['sql'] = [
|
$update_schema[10]['sql'] = [
|
||||||
'about_files' => "ALTER TABLE `{$dbprefix}files` ADD `about` LONGTEXT NULL DEFAULT NULL AFTER `real_filename`;",
|
'about_files' => "ALTER TABLE `{$dbprefix}files` ADD `about` LONGTEXT NULL DEFAULT NULL AFTER `real_filename`;",
|
||||||
];
|
'enable_multipart' => "INSERT INTO `{$dbprefix}groups_data` (`group_id`, `name`, `value`) SELECT `group_id`, 'enable_multipart', 1 FROM `{$dbprefix}groups`;",
|
||||||
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user