Ticket #3366 (closed defect: worksforme)

Opened 5 years ago

Last modified 3 years ago

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:
Depends on:
Workaround:
Verified:

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

DownloadApplication.java Download (941 bytes) - added by peter.lehto 5 years ago.
DownloadResource.java Download (1.4 KB) - added by peter.lehto 5 years ago.
DownloadResource.2.java Download (1.7 KB) - added by Watt Lee 4 years ago.
GAE version
GaedltestApplication.java Download (1.8 KB) - added by Artur Signell 3 years ago.

Change History

Changed 5 years ago by peter.lehto

Changed 5 years ago by peter.lehto

comment:1 Changed 5 years ago by Artur Signell

  • Milestone set to Vaadin 6.1.1

comment:2 Changed 5 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).

Changed 4 years ago by Watt Lee

GAE version

comment:3 Changed 4 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)

...

Changed 3 years ago by Artur Signell

comment:4 Changed 3 years ago by Artur Signell

  • Status changed from reopened to closed
  • Resolution set to worksforme

Tested file download in Google App Enginen using Vaadin 6.6.1 and AppEngine SDK 1.5.1. Found no problems with IE8 (or IE9/Chrome 12/Firefox 5), test case attached.

Note: See TracTickets for help on using tickets.