Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » how to locate a url and download a file without generating html in html and clicking it?
how to locate a url and download a file without generating html in html and clicking it? [message #748118] Mon, 24 October 2011 09:57 Go to next message
Eclipse UserFriend
Hi all,
in my project, I want to generate a dynamic download service handler with a excel inputstream in it and download the excel file directly without generating a browser object and html code. but how to execute the link to download the file?

thanks
David
Re: how to locate a url and download a file without generating html in html and clicking it? [message #749431 is a reply to message #748118] Tue, 25 October 2011 04:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi David,

I guess the best way to provide a download is to use a dedicated
download widget. There is an open enhancement request [1] for this with
an example implementation attached to it. I didn't try it so far, but
maybe it is helpful for you.

Regards, Ralf

[1] 331157: Provide download widget
https://bugs.eclipse.org/bugs/show_bug.cgi?id=331157

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: how to locate a url and download a file without generating html in html and clicking it? [message #751217 is a reply to message #749431] Tue, 25 October 2011 22:15 Go to previous messageGo to next message
Eclipse UserFriend
thanks a lot , the way is not so good but it works anyway.
Re: how to locate a url and download a file without generating html in html and clicking it? [message #752510 is a reply to message #751217] Wed, 26 October 2011 08:16 Go to previous messageGo to next message
Eclipse UserFriend
On 10/26/2011 04:15 AM, micromms wrote:
> thanks a lot , the way is not so good but it works anyway.

What is not so good about it? Your comments are welcome on the bug report!

Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: how to locate a url and download a file without generating html in html and clicking it? [message #752865 is a reply to message #752510] Wed, 26 October 2011 10:49 Go to previous message
Eclipse UserFriend
my way is as below,

create an IServiceHandler implemented class,
response.setContentType( "application/ms-excel" );
      String contentDisposition = "attachment; filename=" + fileName;
      response.setContentType("application/force-download");
      response.setHeader("Content-Disposition", contentDisposition);
      response.setHeader("Content-Transfer-Encoding", "binary");
      response.setHeader("Pragma", "no-cache");
      response.setHeader("Cache-Control", "no-cache, must-revalidate");


and invoke like this,

RWT.getServiceManager().registerServiceHandler( SERVICE_HANDLER,  new ExcelServiceHandler(fileName );


no so good is a new browser window opened every time to download the file, and opening new window is limited by many browsers and other tools!

Anybody has better ways?

David
Previous Topic:Ignored plugin.xml
Next Topic:Browser refresh issue
Goto Forum:
  


Current Time: Tue Jul 22 19:20:17 EDT 2025

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

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

Back to the top