In GWT, you can send a file to the server using the http form methods, and you must use the provided HttpServlet to receive and save data as binary blogs in Appengine BigTable.
Then you need a second HttpServlet to read the file from the large table, set the MIME type to HTTP HEADER {and cache parameters}, and then transfer the file to the user.
Although RPC is REQUIRED, you must tell the client that the generated fileId is available so that it can access it {if you do not want the user to supply an identifier and make them worry about name rewriting ...... ick} . Either you can use rpc to request the / single id list {for example, "the newest file identifier by user"}, or you can return this identifier in the body of the UploadServlet response ... but then you need to make sure your target post is in- page iframe, poll to make sure the iframe has a body between the submit message and the actual server response, and then parse and use this id in gwt to create an img or object tag that uses this file.
The key part has one servlet for loading, and another for loading. Remember, BigTable just stores binary blobs, so you also need your data object to have a mime / content type that can be read from the input file {never rely on file extensions!}. In addition, BigTable has 1 MB per entity, and 10 MB for free accounts. You may want your data object to contain a list of 1-10 blocks, each of which has a maximum of 1024 bytes.
In principle, it’s best to find a working free copy, such as the Google File Service, and expand it to find out how the system works.
If you want, I will send my own version of open source file processing as soon as I finish the gwt control widgets and can consider everything stable enough to be useful to everyone. Send x AT aYX DOT if you want me to send you a beta code jar.
Alyxandor Aug 12 '09 at 7:34 2009-08-12 07:34
source share