Return to Snippet

Revision: 40421
at February 1, 2011 23:41 by arunpjohny


Initial Code
response.setContentType(contentType);
response.setHeader("Content-Disposition", "Attachment;Filename=\"" + fileName + "\"");
response.setHeader("Cache-Control", "private, max-age=5");
response.setHeader("Pragma", "");
response.setContentLength(length);

Initial URL
http://geekcredential.wordpress.com/2009/04/21/grails-file-serving-controller-and-tomcat-ssl-problem/

Initial Description
When downloading a file using SSL, IE throws an exception if the Prgama header is set as no-  cache. When we uses Apache Tomcat with security-constraint CONFIDENTIAL if the cache control  headers(Cache-Control and Pragma) are not present in the response, Tomcat will add them. This will fail in IE. So we need to manually set the cache control values in the servlet itself

Initial Title
IE-SSL download issues

Initial Tags


Initial Language
Java