UtilHttp.streamContentToBrowser problem with IE

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

UtilHttp.streamContentToBrowser problem with IE

Michael Imhof
To download files from server, we're using the Ofbiz method
UtilHttp.streamContentToBrowser

But this function is not working properly with Internet Explorer (Tested with IE 6.0).
I figured out, that the cache control property "Pragma" causes the error.
So, when I comment this line, the download is working with IE.

What is this property for? Can we obmit this property?

  public static void setResponseBrowserProxyNoCache(HttpServletResponse response) {
        long nowMillis = System.currentTimeMillis();
        response.setDateHeader("Expires", nowMillis);
        response.setDateHeader("Last-Modified", nowMillis); // always modified
        response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); // HTTP/1.1
        response.addHeader("Cache-Control", "post-check=0, pre-check=0, false");
        // The following line causes an error in IE
        // response.setHeader("Pragma", "no-cache"); // HTTP/1.0
   }

Michael