file uploading

144 views
Skip to first unread message

Khadija Ferjani

unread,
Sep 19, 2012, 10:53:24 AM9/19/12
to lib-gw...@googlegroups.com
Hello everyone,
Thanks for writing the lib, it's really helpful.
I need to recuperate the content of the uploaded file  and for that, I'm calling:
reader.readAsText(file);
and just after it, I call:
reader.getStringResult();

The problem is that the last method returns always a blank String (my input is a text-file)
Could someone please help me ?

Thanks !

Lukas Laag

unread,
Sep 24, 2012, 3:20:28 AM9/24/12
to lib-gw...@googlegroups.com
Hi Khadija,

Actually the API works asynchronously. You need to setup a callback
which will be invoked when the file has been read, and then only can
you access the content of the file with reader.getStringResult. You
can have a look at the sample application to see how this can be done:

http://www.vectomatic.org/mvn-sites/lib-gwt-file-test-latest/xref/org/vectomatic/file/client/TestAppMain.htmlhttp://www.vectomatic.org/libs/lib-gwt-file

Regards

Lukas
Reply all
Reply to author
Forward
0 new messages