Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Eclipse Scout download file
Eclipse Scout download file [message #1770284] Wed, 09 August 2017 11:47 Go to next message
Eclipse UserFriend
I have a scout application that provides a download button which calls a function on the server side returning a string which I want to save (download) as a file for every user clicking on that button. What is the best way to do that with the new scout APIs?

Here is a related old forum post from 2012:
https://www.eclipse.org/forums/index.php/t/366585/

[Updated on: Wed, 09 August 2017 11:52] by Moderator

Re: Eclipse Scout download file [message #1770330 is a reply to message #1770284] Thu, 10 August 2017 01:55 Go to previous messageGo to next message
Eclipse UserFriend
Downloading a file (actually an arbitrary byte[] array) can be implemented easily, for example you could use the following code:

BinaryResource resource = new BinaryResource("filename.txt", "Hello world".getBytes());
getDesktop().openUri(resource, OpenUriAction.DOWNLOAD);


This codes assumes that it runs within the client package and that a desktop is available, for example I used the code above on a Form. If no getDesktop() method is available you could also try IDesktop.CURRENT.get() instead.
Re: Eclipse Scout download file [message #1770331 is a reply to message #1770330] Thu, 10 August 2017 02:43 Go to previous message
Eclipse UserFriend
Thank you very much, says it all.

Yesterday I found a similar example at looking at the scout widgets example code, where a jpg is stored within a table, that can be downloaded subsequently from there :)

Previous Topic:Most abstract GUI component for us to customize?
Next Topic:How to preload a Scout TablePage?
Goto Forum:
  


Current Time: Fri Jun 13 10:11:28 EDT 2025

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

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

Back to the top