Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Force Download CSV in IE9(Force Download CSV in IE9)
Force Download CSV in IE9 [message #972314] Mon, 05 November 2012 14:29 Go to next message
Tobias Semmet is currently offline Tobias SemmetFriend
Messages: 37
Registered: July 2009

i want to force that the user have to download a csv file and open it in excel, at the moment the csv file is shown as a plane text in the browser....

Browser browser = new Browser(shell, style);


Can you help me please,

Re: Force Download CSV in IE9 [message #972381 is a reply to message #972314] Mon, 05 November 2012 15:31 Go to previous message
Cole Markham is currently offline Cole MarkhamFriend
Messages: 143
Registered: July 2009
Location: College Station, TX
Senior Member

If you want to display it and have the user download it, then you will need to open it twice in the user's browser. See the FAQ entry for providing a download link[1] which has an example of using a ServiceHandler to set the appropriate headers to force the download. You will probably want to set the content type appropriately. Setting the url into a Browser widget should work for displaying the file. A common approach for initiating the download is to use a hidden Browser widget (size 0x0), but that will often get blocked in IE. The most reliable method is described in the FAQ which is to provide a link for the user to click.

Another idea would be to wrap your CSV in an HTML page for displaying in the Browser widget, and in the HEAD of that HMTL put a meta refresh tag like this:
<meta HTTP-EQUIV="REFRESH" content="5; url=/service-handler-url?download=true">

That should give the content time to load, then "redirect" to the download version which will actually leave the original content in place. It's kind of a hack, but it may work for what you need.

Hope that helps,


Previous Topic:Where can I download the file upload jars
Next Topic:Problem with RWT-OSGi integration bundle on JBoss 7.2
Goto Forum:

Current Time: Sun Jun 17 22:40:04 GMT 2018

Powered by FUDForum. Page generated in 0.01959 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top