IE cannot download files over SSL served by WebSphere

后端 未结 6 1723
眼角桃花
眼角桃花 2021-02-15 18:22

IE 7 & 8 both throw an error when users attempt to download a csv file over https.

Internet Explorer cannot download downloadPage.jsf. Internet Explor

6条回答
  •  醉话见心
    2021-02-15 18:51

    Had the exact same issue when the app server was configured to use SSL. The trick for me to get it working after the https was turned on:

       string attachment = "attachment; filename=" + rptName + ".xls" + "";    
    
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.AddHeader("content-disposition", attachment);
        HttpContext.Current.Response.AddHeader("Cache-Control", "private, max-age=1");
    
        HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
    
        HttpContext.Current.Response.Charset = "";
        HttpContext.Current.Response.Buffer = true;
        HttpContext.Current.Response.Cache.SetExpires(DateTime.Now.AddMinutes(1));
    

提交回复
热议问题