shgwh, I'd just use a normal servlet rather that the GWT RPC one for file upload. Search the web for file upload servlet and you'll get plenty of examples, on the client side you use the fileupload component in a form and post the data to yout servlet (for example the last post here: http://groups.google.se/group/Google-Web-Toolkit/browse_thread/thread/19ea5c6be6d47848/8a4439de9cd48006?hl=sv&lnk=gst&q=fancy+file+upload#8a4439de9cd48006 which uses some apache commons libraries).
To use the servlet in web mode you'll need to add a "servlet" tag to your module XML definition, and for web mode you'll need to add an entry to your servers web.xml file in the normal way. //Adam On 9 Feb, 22:13, shgwh <[email protected]> wrote: > So actually i'm trying to upload a file by gwt > functions: > protected String readContent(HttpServletRequest request) > throws ServletException, IOException { > return RPCServletUtils.readContentAsUtf8(request, true); > } > public String processCall(String payload) throws > SerializationException { > try { > RPCRequest rpcRequest = RPC.decodeRequest(payload, this.getClass > (), this); > return RPC.invokeAndEncodeResponse(this, rpcRequest.getMethod(), > rpcRequest.getParameters(), rpcRequest.getSerializationPolicy > ()); > } catch (IncompatibleRemoteServiceException ex) { > getServletContext().log( > "An IncompatibleRemoteServiceException was thrown while > processing this call.", > ex); > return RPC.encodeResponseForFailure(null, ex); > } > } > > These are the implemtation in RemoteServiceServlet, I cannot override > doPost function as it's final, so i have to override these two > functions > But I tried to just return some simple characters, and it opens a file > download window in my browser...So what should i do actually? I think > i need a sample, as simple as possible. > > Thank you. > > BTW, this is the first time i send a message in english forum, so i'm > sorry if i make something wrong. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
