views:

70

answers:

1

Is there a consistent code-base that allows me to upload a zip file to both GAE and Tomcat-based servers, extract the contents (plain-text files), and process them?

A: 

Both supports Java, so you can just use Java :)

In all seriousness, processing file uploads can be done with Apache Commons FileUpload and extracting them can be done with java.util.zip API.

See also the answers on those similar questions which are asked last two days, probably by your classmates/friends:

BalusC
Uploading is no issue for Tomcat of course, but GAE does not allow access to the filesystem, and the only alternative seems to be using the Blobstore service. I've been through the zip API and appears that the zip constructor requires a filepath. As far as GAE goes, a ZipInputStream is as good as it gets. The only information extractable are the filenames/sizes of the ZipEntries, and not the actual data therein.
James Tay
It now look much like that you're confusing "uploading a file to webserver" with "saving a file on webserver's disk". In the future, please take care with the terminology. At least, this shouldn't be a problem as long as you don't write the uploaded file to disk. The ZIP API just requires the pathname **inside** the zip file. Further, if I am not mistaken, GAE supports a virtual file system: http://code.google.com/p/gaevfs/wiki/UsingGaeVFS This may be useful.
BalusC