Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read local (Client) file with GWT?

I would like to use GWT to read and parse local csv file. EDIT: Local file here means client file.

I know I can use HTML5 with javascript to achieve that, but I would like to use GWT to do it.

One way of doing it is by using JavaScript Native Interface (JSNI), however I think it beats the purpose of using GWT.

Another way of doing this would be upload the file to server, and send it back as a json. But I feel it's not the best way of doing it.

Please advise. Thanks.

EDIT: I intend to design a desktop app, so I try to avoid using any web-server scripting.

like image 375
janetsmith Avatar asked Aug 02 '11 00:08

janetsmith


1 Answers

Using jsni doesn't beat the purpose of gwt, sometimes you need to use it as a wrapper to functionality not yet available in gwt or an external javascript library. Instead of writting jsni access to the file api you can use one of several third party libraries available that implement html5 file access, like http://code.google.com/p/lib-gwt-file

like image 173
Hilbrand Bouwkamp Avatar answered Nov 12 '22 01:11

Hilbrand Bouwkamp