struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pratt <thechrispr...@gmail.com>
Subject Re: IE open excel file directly but not save as
Date Mon, 26 Sep 2011 17:40:33 GMT
Try removing the filename from the Content-Disposition header.  "inline"
doesn't support this attribute and maybe IE is assuming you mean "external"
because it's there.
  (*Chris*)

On Mon, Sep 26, 2011 at 10:30 AM, Emi Lu <emilu@encs.concordia.ca> wrote:

> Hello ,
>
> I know its not really struts question. But maybe someone knows the answer.
>
> IE cannot open an excel file directly (IE8,9)
>
>  res.reset();
>  res.setHeader("Cache-Control", "private, must-revalidate");
>  res.setHeader("Pragma","**private");
>  res.setContentType("**application/vnd.ms-excel");
>  res.setHeader("Content-**Disposition", "inline;filename=\""+ "fn.xls" +
> "\";");
>  res.setContentLength(fileData.**length);
>  res.setHeader("Content-**Transfer-Encoding", "binary");
>
> If I save as a file, open it, excel shows:
>
>  "Office File Validation detected a problem while trying to open this file.
> Opening it may be dangerous"
>
> Then I have to click "open" to open it.
>
> Does someone know how to open excel file directly but not have to save as
> under IE please?
>
> thanks a lot!
> Emi
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<user-unsubscribe@struts.apache.org>
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message