Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-10648

download/file.php with gzip compression: invalid content length produces corrupt file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • 3.0.15-RC1, 3.1.12-RC1
    • 3.0.10, 3.1.3
    • Other
    • None
    • Debian Lenny, PHP 5.2.X, lighttpd

      Citing Support topic:

      There is a bug present in the current phpBB release preventing downloading of some file types only if gzip compression is enabled on the server (via php.ini) by default. If so, and gzip is disabled in phpbb's settings (php.ini -> enabled, phpBB -> disabled), content lengths sent by phpBB via download/file.php does not match the actual content length transfered. This is caused because phpBB sets the content length manually and PHP (5.2.X) does not correct it when compressing the transfered contents via gzip, resulting in a corrupted file after download (IE, Chrome and Firefox have been tested). I am not sure if there is something else special about my server setup, so it may, or may not, be present everywhere else (Debian Lenny, PHP 5.2.X, lighttpd).

      A simple fix for this issue is adding the following line to download/file.php:

      ini_set('zlib.output_compression', 'Off');

      For me, this solved the issue. However, a real bug fix should of course take the administrator's phpBB gzip setting into account. Hope I could help

            CHItA CHItA
            AmigoJack AmigoJack
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: