mod_deflate and file.php

mod_deflate and file.php

by Chris Fryer -
Number of replies: 0
Hello all,

I know it's a really busy time what with the upcoming release of 1.8, but I was hoping others might be able to help me pin down an issue we've been experiencing with Apache's mod_deflate and Internet Explorer. The background to the "bug" is on the tracker here: http://tracker.moodle.org/browse/MDL-8382

Essentially, files being served by file.php are being compressed by mod_deflate. Poor old Internet Explorer doesn't seem to understand this. When a user requests a zip file, it is compressed (because Apache assumes PHP's output is text, I think), and Internet Explorer cheerfully hands it to your unzipping application without inflating it first. The user is presented with an error message that the zip file is corrupt. Firefox, naturally, knows what to do.

I'm trying to zero in on specific implementations where the problem occurs. I can recreate the error on Apache 2.0.58 and 2.0.59 running on a Windows box. This is our mod_deflate configuration:

AddOutputFilterByType DEFLATE text/html text/plain text/xml

If anyone has the time to do so, I'd be extremely grateful if you could enable mod_deflate on your Apache test server and see what happens when you try to download a zip file using Internet Explorer.

A number of workarounds exist, most of which don't require changes to Moodle code. I'd like to find out which is best and document it in the wiki.

Regards,

Chris
Average of ratings: -