Ticket #3366 (closed defect: worksforme)
File download as StreamResource doesn't start when using IE8
| Reported by: | peter.lehto | Owned by: | ticketmaster |
|---|---|---|---|
| Priority: | normal | Milestone: | Vaadin 6.1.1 |
| Component: | Core Framework | Version: | 6.1.0 |
| Keywords: | Cc: | ||
| Hours estimate: | Hours done: | ||
| Depends on: | |||
| Workaround: | |||
Description
File download as StreamResource doesn't start with IE8 when content-disposition is specified to attachment. IE8 pops up a new browser window but closes it right away without downloading the file.
Other browser show file download dialog properly.
If content-disposition is not specified files are opened in new browser window instead of downloading them.
Following example code tested to work with (FF 3, 3.5, Opera 9, Safari 4).
Attachments
Change History
comment:2 Changed 4 years ago by Artur Signell
- Status changed from new to closed
- Resolution set to worksforme
I fail to see the problem in Vaadin in this.
IE8 has a download prompter "automatic prompting for file downloads" (in security settings). If this is OFF there will be a yellow bar showing that the download has been denied by default and you should click it if you want to download the file. This is apparently what happens in the test case although and then IE8 closes the window immediately after that, never showing the bar.
If you enable "automatic prompting for file downloads" it will work as expected.
A better way however seems to be to use "" or "_self" instead of "_blank" (_new is not standard). Then the file will be downloaded in the current window and the possible warning bar is displayed (although it requires a reload of the page to be enabled, way to go IE8).
comment:3 Changed 3 years ago by Watt Lee
- Status changed from closed to reopened
- Resolution worksforme deleted
AS Artur Signell described: After _new is replaced by _self, the source code works fine. Then I did some modifications and tested with Vaadin 6.3.4/GAE 1.3.4, IE8 report HTTP ERROR 500 as the following.
Is there anything wrong with the source code attached?
HTTP ERROR 500 Problem accessing /APP/1/test.zip. Reason:
INTERNAL_SERVER_ERROR
Caused by: java.lang.IllegalArgumentException
at org.mortbay.jetty.Response.sendRedirect(Response.java:386) at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:129)
...

