|
Re: Force Download CSV in IE9 [message #972381 is a reply to message #972314] |
Mon, 05 November 2012 15:31 |
|
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,
Cole
[1] http://wiki.eclipse.org/RAP/FAQ#How_to_provide_a_download_link.3F
|
|
|
Powered by
FUDForum. Page generated in 0.05462 seconds