Generated PDFs over HTTPS with Internet Explorer

Please see my new blog


One of the applications I’ve been working on generates PDF files which the customer can download. I’m using the FPDF and FPDI libraries to import PDFs and create copies with generated contents. This has been really easy to code, and it’s been working flawlessly in both Firefox and Safair. When we started testing under Internet Explorer thing started breaking. The problem was that IE would not let the user download the file. The only feedback we got was error messages like “The file is currently unavailable or cannot be found.  Please try again later.” and “The file could not be stored in cache”. After spending some time debugging I found out that IE has problems with file downloads over HTTPS. Google pointed me to http://in2.php.net/manual/en/function.header.php#74736. The guy in that post spent six hours figuring it out, and he probably saved me six hours as well. The magic required to satisfy Internet Explorers needs:

header(‘Cache-Control: maxage=3600’);
header(‘Pragma: public’);

Spread the message so others can spare some time!

Advertisements

9 Comments

  1. Markus said,

    October 31, 2007 at 1:08 pm

    Thank you! 🙂

  2. tyler said,

    November 7, 2007 at 9:44 pm

    you’re awesome.

  3. Roshan said,

    November 16, 2007 at 8:10 am

    Thank You 🙂

  4. eirikhoem said,

    November 16, 2007 at 8:16 am

    I’m just glad to spread the word 🙂

  5. Jerronimo said,

    December 4, 2007 at 6:02 pm

    I love you man! You’re my god!

  6. Patrick said,

    December 31, 2007 at 10:34 pm

    Awesome! I love M$ products! They’re so…. in need of repair 😉

  7. Brad Cupit said,

    January 19, 2008 at 5:52 pm

    Oh man, you just saved me sooo much time! Thanks for the awesome post!

  8. Oz said,

    February 27, 2008 at 3:12 pm

    Thank you!

  9. Dave Lewicki said,

    March 13, 2008 at 8:10 am

    Worked like a charm. THANKS!!!!!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: