0

I've searched and searched, coming across questions that address parts of the problem, but nothing comprehensive. I'm using GWT and eclipse to develop a website that uses highcharts to make some fancy plots.

The idea is that the user will be able to select one of their local data files of type csv and upon selection of the file, the plot will be rendered using their data and our fancy algorithms.

We don't want to send enormous amounts of data to the server as this will become costly and time consuming for the user. Is there a way to process or at least pre-process the user's data using Java code to be implemented in a GWT-eclipse project?

Any help is greatly appreciated!

appbootup
  • 9,537
  • 3
  • 33
  • 65
user1998197
  • 3
  • 1
  • 1

2 Answers2

0

This is a duplicate of GWT Toolkit: preprocessing files on client side

One of the answers points to these links:

http://code.google.com/p/gwt-nes-port/wiki/FileAPI - GWT wrapper for HTML5 File API

http://www.html5rocks.com/en/tutorials/file/dndfiles/ - HTML5 FileAPI

But, alas, the FileAPI is pretty new: http://caniuse.com/fileapi

The other alternative you have, to avoid server, is a text area to paste the CSV file into, then read that using GWT. This is a common trick and I think you can even copy+paste from certain spreadsheet programs this way.

Community
  • 1
  • 1
Tom Carchrae
  • 6,398
  • 2
  • 37
  • 36
  • I've taken a look at the htm5rocks tutorial, might be able to make that work. We are willing to deal with selective browser support for the time being. That text area is an interesting idea, I'll look into it. Thanks for your help! – user1998197 Feb 04 '13 at 19:43
0

You cannot do it in a universal way in GWT in all browsers currently. GWT translates to javascript and it does not have the required privileges to process client side the files.

For more detailed answer you can reference - How to retrieve file from GWT FileUpload component?

Community
  • 1
  • 1
appbootup
  • 9,537
  • 3
  • 33
  • 65