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 );
|
||||
}
|
||||
|
||||
function output_file($path) {
|
||||
function output_file($path, $chunkSize=1024) {
|
||||
if (connection_status() != 0)
|
||||
return false;
|
||||
$parts = pathinfo($path);
|
||||
|
@ -2378,12 +2378,11 @@ function output_file($path) {
|
|||
header("Content-Transfer-Encoding: binary");
|
||||
header("Content-Type: $contentType");
|
||||
|
||||
$contentDisposition = 'attachment'; if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
|
||||
$fileName = preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1);
|
||||
header("Content-Disposition: $contentDisposition;filename=\"$file\"");
|
||||
} else {
|
||||
header("Content-Disposition: $contentDisposition;filename=\"$file\"");
|
||||
$contentDisposition = 'inline';
|
||||
if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
|
||||
$file = preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1);
|
||||
}
|
||||
header("Content-Disposition: $contentDisposition;filename=\"$file\"");
|
||||
|
||||
header('Accept-Ranges: bytes');
|
||||
$range = 0;
|
||||
|
@ -2400,7 +2399,7 @@ function output_file($path) {
|
|||
} else {
|
||||
$size2 = $size - 1;
|
||||
header("Content-Range: bytes 0-$size2/$size");
|
||||
header("Content-Length: " . $size);
|
||||
header('Content-Length: ' . $size);
|
||||
}
|
||||
|
||||
if ($size == 0) {
|
||||
|
|
Loading…
Reference in New Issue