Actually, there are two ways of uploading file with gwtupload as you mentioned and via gwt-rpc this one is a bit difficult due to browser security. For implementing with gwt-rpc you should override service(final HttpServletRequest request,HttpServletResponse response)
method inside your service implementation which inherits RemoteServiceServlet
.
For client-side you should have code something like this:
final FormPanel formPanel = new FormPanel();
formPanel.setAction(GWT.getModuleBaseURL()+”fileUpload”);
formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
formPanel.setMethod(FormPanel.METHOD_POST);
Inside service
method you can get the file with using FileUpload, and don't forget registering fileupload url pattern in your web.xml and also @RemoteServiceRelativePath("path")
in your service interface which inherits RemoteService
. Good Luck!