PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Download » Bug #3263

Acrobat hangs on multiple ranges

Details

Submitted2005-01-21 22:38 UTC
Fromsbaturzio at satellite1 dot 191 dot it
Assignedmike
StatusClosed
PackageHTTP_Download
PHP Version4.3.10
OSLinux 2.6.9 (Debian unstable)
Roadmaps(Not assigned)

Comments

[2005-01-21 22:38 UTC] sbaturzio at satellite1 dot 191 dot it

Description:
------------
Downloading a big PDF file (> 30KB), with disposition inline, to a Acrobat Reader plug-in (v 5.0.10) the file is sent in chunks but the download is not completed. Seems the multibyte ranges are not managed correctly.

Reproduce code:
---------------
A simple download using:

$fileName = 'bigFile.pdf';
$mimeType = 'application/pdf';
$aParams = array('file' => $fileName,
'contenttype' => $mimeType,
'contentdisposition' => array(HTTP_DOWNLOAD_INLINE, $bigFile),
);
$error = HTTP_Download::staticSend($aParams, false);

is what I used.
Small PDF files are downloaded in a single chunk and they works.

A workaround to this problem is to commenting the line 170 of Download.php in:
// 'Accept-Ranges' => 'bytes',

In this way the download is done in one single chunk and Acrobat Reader works fine.

Expected result:
----------------
Acrobat reader download and show big PDF downloaded file.

Actual result:
--------------
Acrobat Reader is loaded by the browser but instead of showing its interface, button bars, thumbnail tab on the left and main window with document page inside, it shows a completely blank browser window.
Looking at the headers transmitted to and from the browser I see HTTP/Download send a first 200 HTTP code, then 206 code to answer to a partial request. Maybe a second chunk is sent to the Acrobat Reader but then nothing is transmitted.

[2005-01-21 22:41 UTC] sbaturzio at satellite1 dot 191 dot it

Forgot to say that I'm using apache 1.3.33 and the browser used are Mozilla Firefox (on Linux and Windows) and IExplorer 6 (Windows)

[2005-01-23 01:14 UTC] sbaturzio at satellite1 dot 191 dot it

Sorry Helgi, but I need to download files with disposition 'inline'.

Actually I've made a workaround at this problem extending the Download class and adding a method which let me change the $headers['Accept-Ranges'] without modify the original class:

function setAcceptRanges($param) {
if ($param == 'bytes') {
$this->headers['Accept-Ranges'] = $param;
} else {
$this->headers['Accept-Ranges'] = 'none';
}
}