Chrome 10.0 Downloading Files Automatically

Well-known member

Has anyone else experienced the issue of Chrome downloading files automatically? On XenForo it asks me if I wish to download files (threads.html, download.html, etc) and on other sites it just downloads them straight away.

Well-known member

I've seen it too, most often on sites that run some rather intensive PHP scripting. Usually clears up on its own. Just a wild stab: I am thinking one of the HTTP headers (maybe "content type" or "mime type") gets mangled, and the browser doesn't know what to do with the file. Hence it triggers a download rather than parse the incoming HTML data and render a page with it.

Well-known member

As such, it is not a problem with either the forum software or the browser. There is something happening on the server that could be triggering this. I never did find the real reason myself, but like you say above, if there is a module reloading or something else happening on the server, it could be possible that a content/mime-type header is getting corrupted, and the browser does not know the incoming file is "text/html" or whatever type it sends along. The browser just thinks, "OK, unknown file type...we download it." That was all I could ever figure out.

I encountered an "issue" with Google Chrome that I actually reported to their developers. (One of my "neighbors" at our hosting company works for Google and has worked with the Chrome developers.) I have visited sites where images would load into the browser, then disappear right after they had loaded. Not too often, but it happened. Unfortunately, the "not too often" involved our forum and the gallery system (Gallery2/Menalto) I was using on another part of the site. Since phpBB2 did not have an attachment feature built in, we would upload to the gallery, then link to the images. Chrome would always fail on those images.

Some digging turned up an issue: the content-length HTTP header was being sent incorrectly from Gallery. Let's say the image is 24,755 bytes. Gallery was sending an incorrect content-length string. So it was telling the browser, "OK, here are 24,798 bytes" or whatever it was sending. The browser sees an image file one size, but it is told by the sender that it is a different size. Chrome just follows the content-length header for the image strictly and, if not a match, it quits displaying the image. This is one case where following strict coding breaks something in the browser.

All I did was find the code in Gallery2 that sent the content-length header and commented it out. Instant fix! All of the images in our forum now loaded in Chrome.

This is just one rather wordy example of how a botched header (or an overly-strict browser) can change expected behavior in an application...