Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.4

Bug #3263 Acrobat hangs on multiple ranges
Submitted: 2005-01-21 22:38 UTC
From: sbaturzio at satellite1 dot 191 dot it Assigned: mike
Status: Closed Package: HTTP_Download
PHP Version: 4.3.10 OS: Linux 2.6.9 (Debian unstable)
Roadmaps: (Not assigned)    
Subscription  


 [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.

Comments

 [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-21 22:56 UTC] dufuz
Well just so it's know, last summer I used HTTP_Download to serve PDF files which were over 250 pages, and had no problems, I just forced people to choose save or open and there was no problem in that. Maybe you should try that instead of allowing them to open acrobat with out any question screen.
 [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'; } }
 [2005-01-24 11:34 UTC] mike
Mine even hangs. It did work in the past, so I'll need to walk through the CVS logs... Thanks.
 [2005-01-24 13:09 UTC] mike
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.