Wednesday, January 30, 2013

Re: How to upload a file only on the client side?

Hi,

AFAIK you can not access this file on the client as it would violate the sandbox principle. To do something like this, you could use the HTML5 file api → maybe this library will help you: http://code.google.com/p/lib-gwt-file/


Cheers,

Lukasz


Am Mittwoch, 30. Januar 2013 13:26:23 UTC+1 schrieb membersound:
Hi,

I defined a file upload. I do not want to send the file to the server, but instead directly show the content (txt file) to the user. How could I do this: getting the content of the file? What am I missing?

@UiField FormPanel form;
@UiField FileUpload upload;
@UiField Button submit;

form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);

@UiHandler("submit")
void onSubmit(ClickEvent event) {
    form.submit();
}

@UiHandler("form")
void onSubmitForm(SubmitCompleteEvent evt) {
    Sysout("this never executes: " + evt.getResults());
}

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment