First of all, thanks a lot for your answer. You understand perfectly my problem and i have understood your answer. I can assume that what i want is imposible from client side. I would prefer dont write an independent servlet because on my server side i have a REST server, so i guess use it is better. If i never can write a local file from javascript, the only way that i have is upload the file (i guess i would can get the path or file to do it) and transform on the server side. What would be the better way to do it? FormPanel with submit button (and fileupload of course)? Use JQuery? Flash component?
Thanks a lot!! Ignasi 2010/10/19 Jim Douglas <[email protected]>: > 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. > > -- 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.
