Generated PDFs over HTTPS with Internet Explorer
June 15th, 2007
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 Safari. 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 this post. 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:
1 2 | header('Cache-Control: maxage=3600'); header('Pragma: public'); |
Spread the message so others can spare some time!







October 31st, 2007 at 1:08 pm
Thank you!
November 7th, 2007 at 9:44 pm
you’re awesome.
November 16th, 2007 at 8:10 am
Thank You
November 16th, 2007 at 8:16 am
I’m just glad to spread the word
December 4th, 2007 at 6:02 pm
I love you man! You’re my god!
December 31st, 2007 at 10:34 pm
Awesome! I love M$ products! They’re so…. in need of repair
January 19th, 2008 at 5:52 pm
Oh man, you just saved me sooo much time! Thanks for the awesome post!
February 27th, 2008 at 3:12 pm
Thank you!
March 13th, 2008 at 8:10 am
Worked like a charm. THANKS!!!!!
April 28th, 2008 at 2:52 pm
[…] Related posts: Generated PDFs over HTTPS with Internet Explorer […]
June 11th, 2008 at 4:25 pm
hi, I have the same problem but with java struts,and the code is that:
response.setContentType(”application/pdf”);
response.setHeader(”Content-Disposition”, “attachment;Cache;filename=\”" + ruta + “\”");
Can you help me?