Hi,
maybe is coz you are setting the content-header after sending the
content itself.
I think you should do it before.
Hope this helps.
Dani
----- Mensaje Original -----
De: "Siegel, Craig" <[EMAIL PROTECTED]>
Fecha: Jueves, Octubre 5, 2000 3:10 pm
Asunto: zip files; compressing data
> I am trying to send compressed data to the client. The following
> code will
> compress the data, but rather than forcing a "Save As/Open With"
> dialog box,
> it simply writes the binary data to the container window (i.e the
> client'sbrowser).
> Does anybody know how to commpress data and send the resulting
> "zipped"information to the client.
> (Please note that due to system restraints, I cannot create a temp
> file on
> the server.)
>
>
> {current output is as follows:
> PK -QE) test??
> P?,.Q??I,.NU(?KQ(N??K?? PK Yy? PK -QE)Yy? testPK 2N
> }
>
> code excerpt:
>
> <%@ import="java.io.*, java.util.zip.*" %>
> <%
> ZipOutputStream o = new
> ZipOutputStream(response.getOutputStream());
> ZipEntry z = new ZipEntry("test");
>
> o.putNextEntry(z);
>
> String a = "ZIP ist Klasse und schnell";
>
> o.write(a.getBytes());
> o.flush();
> o.close();
>
> response.setHeader("Content-Encoding", "application/zip");
> %>
>
>
========================================================================
===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
________________________________________________________________
Consigue tu cuenta gratuita de acceso a internet y de correo en
http://www.navegalia.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets