Opened 5 years ago

Closed 3 years ago

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

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 (4)

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

Download all attachments as: .zip

Change History (9)

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

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

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

  • Resolution worksforme deleted
  • Status changed from closed to reopened

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

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

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.

comment:5 Changed 6 months ago by Artur Signell

  • Fv unset
Note: See TracTickets for help on using tickets.