Let's see if I understand your requirements: You want to have the user select a file using a FileUpload on a FormPanel. You then want to perform some transformations on that file, including generating a Base64 string. You want the final result of those transformations to reside on the server?
First, eliminate the impossible: * You cannot write a file on the client. This isn't a GWT restriction, it's a core browser restriction. This restriction is why it's impossible for GWT to emulate java.io.File (http:// code.google.com/webtoolkit/doc/latest/RefJreEmulation.html). * You cannot access the path of the file (but this is rarely a concern). What you want to do is: * Write a FileUploadServlet that resides on your server. * Receive the uploaded file in the doPost method of that servlet. * Do all of your transformations there on the server. Make your life easy -- grab the Apache FileUpload package from http://commons.apache.org/fileupload/, add it to your server classpath, and use it to manage the file upload process in FileUploadServlet. On Oct 19, 4:36 am, null <[email protected]> wrote: > Hi all, > there some way to use java.io.file in client side of my GWT Project? > I need convert a file to string and then to base64. > -I have a javascript code which can convert a string to base64 > -I have a DialogPanel with a FileUpload which get the path and name of > the file that i want upload > > So i just need a way to manipule a file in Gwt. > > Thanks all! -- 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.
