Wednesday, January 30, 2013

How to upload a file only on the client side?

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