Indeed, it works, with ZipInputStream.
Here is a piece of code I use in my zipped file upload servlet :


[...]
             CheckedInputStream csumi = new
CheckedInputStream(req.getInputStream(), new CRC32());
            ZipInputStream zin = new ZipInputStream(new
BufferedInputStream(csumi));
            
            @SuppressWarnings("unused")
            ZipEntry ze;
            StringBuffer buf = new StringBuffer();
            
            while ((ze = zin.getNextEntry()) != null) {
                  int x;
                  
                  while ((x = zin.read()) != -1) {
                      char c = (char) x;
                      buf.append(c);
                  }
            }
            zin.close();
            s = buf.toString();
[...]

Bye.

On 15/09/10 22:51, "Guillaume Laforge" <[email protected]> wrote:

> Hi,
> 
> Have you looked at Java's ZipOutputStream?
> http://download.oracle.com/javase/1.4.2/docs/api/java/util/zip/ZipOutputStream
> .html
> 
> Since you can't create files on the file system, I suspect the approach of
> streaming the zip through a ZipOutputStream would be the most plausible one.
> That and you set a content-disposition header of myfilename.zip.
> And I hope it'll work :-)
> 
> Guillaume
> 
> PS: I've never tried that, but that's what I'd investigate first.
> 
> On Wed, Sep 15, 2010 at 03:19, Bit Liner <[email protected]> wrote:
>> My app creates dinamically two files so that then the users can
>> download these files in one zip file.
>> 
>> But i have problem in implementing this operations.
>> 
>> Some suggestion to help me?
>> Library, if gae supports this operations, etc.
>> 
>> (i have tried to use gaeVfs, but i have met problems: i cannot write
>> the content of a file on the response, so i can download the file but
>> its content is empty )
>> 
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]
>> <mailto:google-appengine-java%[email protected]> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>> 
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" 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-appengine-java?hl=en.

Reply via email to