Saturday, July 31, 2010

Re: Good File Upload Example

For some reason, my previous mail doesn't show, so I'll try this
again. To upload, use the blobstore.
use all the example code except index.jsp from this page:
http://code.google.com/appengine/docs/java/blobstore/overview.html
replace index.jsp with a gwt file similar to the example in this page:
http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/FileUpload.html

Change this line in Upload.java from
BlobKey blobKey = blobs.get("myFile");
to
BlobKey blobKey = blobs.get("textBoxFormElement");

Delete parts of FileUpload that involve the listbox.

Also, use an RPC call to get the form action url. The server side code
for the RPC call should look like this:
return blobstoreService.createUploadUrl("/upload");

Hope this helps :)


On Jul 30, 5:48 pm, alan <alan.sny...@gmail.com> wrote:
> I need to read a csv file from the hard drive to populate a table in a
> dialog box.
>
> This seems to require using the FileUpload class, but I've not found a
> good example of it is use. Could anyone recommend a complete example
> that could accomplish this.
>
> Thanks,

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment