[Welcome] [TitleIndex] [WordIndex

I'm not using Quixote (yet), but since I serve a lot of dynamically generated pdf reports, I'd like to mention one gotcha.

Problem

You want to serve dynamically generated pdf files with ReportLab, but Microsoft Internet Explorer browser seems to completely ignore MIME types, choosing to handle data based on a variety of other factors of its own choosing (e.g. the file extension shown in the URL).

Solution

For most of the conforming browsers (Mozilla, Opera, etc.) you can just add Content-type: application/pdf to the headers and stream the data. If it's an IE browser, however, you should return a URL with a .pdf file extension.


2010-09-22 22:14