Fix downloads due to chunkSize not being defined
parent
87627cac8e
commit
d64868a44b
|
@ -2366,7 +2366,7 @@ function extract_auth_values_from_url($url) {
|
||||||
return array( $username, $password );
|
return array( $username, $password );
|
||||||
}
|
}
|
||||||
|
|
||||||
function output_file($path) {
|
function output_file($path, $chunkSize=1024) {
|
||||||
if (connection_status() != 0)
|
if (connection_status() != 0)
|
||||||
return false;
|
return false;
|
||||||
$parts = pathinfo($path);
|
$parts = pathinfo($path);
|
||||||
|
@ -2378,12 +2378,11 @@ function output_file($path) {
|
||||||
header("Content-Transfer-Encoding: binary");
|
header("Content-Transfer-Encoding: binary");
|
||||||
header("Content-Type: $contentType");
|
header("Content-Type: $contentType");
|
||||||
|
|
||||||
$contentDisposition = 'attachment'; if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
|
$contentDisposition = 'inline';
|
||||||
$fileName = preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1);
|
if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
|
||||||
header("Content-Disposition: $contentDisposition;filename=\"$file\"");
|
$file = preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1);
|
||||||
} else {
|
|
||||||
header("Content-Disposition: $contentDisposition;filename=\"$file\"");
|
|
||||||
}
|
}
|
||||||
|
header("Content-Disposition: $contentDisposition;filename=\"$file\"");
|
||||||
|
|
||||||
header('Accept-Ranges: bytes');
|
header('Accept-Ranges: bytes');
|
||||||
$range = 0;
|
$range = 0;
|
||||||
|
@ -2400,7 +2399,7 @@ function output_file($path) {
|
||||||
} else {
|
} else {
|
||||||
$size2 = $size - 1;
|
$size2 = $size - 1;
|
||||||
header("Content-Range: bytes 0-$size2/$size");
|
header("Content-Range: bytes 0-$size2/$size");
|
||||||
header("Content-Length: " . $size);
|
header('Content-Length: ' . $size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($size == 0) {
|
if ($size == 0) {
|
||||||
|
|
Loading…
Reference in New Issue