The behavior happens when the file is downloaded (not viewed) within 5 seconds. The html headers aren't recognized by the browser, are pre-pended to the file being downloaded, and the file type is disregarded.
The downside with the JPEG is that this corrupts the file type.
Here are two example headers that were included:
HTTP/1.1 200 OK
Date: Mon, 14 May 2007 20:12:10 GMT
Server: Apache
Content-Description: File Transfer
Content-Length: 29841
Content-Disposition: attachment; filename="filemanage.js";
Keep-Alive: timeout=5, max=49
Connection: Keep-Alive
Content-Type: application/force-download
HTTP/1.1 200 OK
Date: Mon, 14 May 2007 20:00:19 GMT
Server: Apache
Content-Description: File Transfer
Content-Length: 736605
Content-Disposition: attachment; filename="DSCN0200.JPG";
Keep-Alive: timeout=5, max=49
Connection: Keep-Alive
Content-Type: application/force-download
I've only been able to replicate this with some JPEG
images, and a javascript file.
My initial theory is that this has to do with the 5 second timeout. When I wait for more than 5 seconds between downloads, the download occurs normally.