If I'm not mistaken, you must set the "Content-Disposition" and
contentType *before* you start writing to the output stream.
On Nov 11, 10:02 am, "Romeryto Lira" <[EMAIL PROTECTED]> wrote:
> I have problem with my zip download servlet. When I go to download, in the
> window that open the mime tipe of the zip file is lost.
>
> *snippet of code:
>
> *String fileName = request.getParameter("filename");
>
> OutputStream out = response.getOutputStream();
> ZipOutputStream zout = new ZipOutputStream(out);
> *...*
>
> zout.close();
> response.setHeader("Content-Disposition", "attachment;filename=\"" +
> fileName + "\";");
> response.setContentType("application/zip");
> out.flush();
> out.close();
>
> I mute the response to mime type "zip" but in download the file name and
> mime types are lost.
> In xml MyApplication.gwt.xml the servlet is declared like this:
>
> <servlet path="/zipdownload"
> class="myapplication.server.files.MyZipFileServlet" />
>
> How to resolve this problem?
>
> Thanks!
>
> Ps.: The error's picture is attached.
> ---------------------------------------------------------------------------
> -----------------------
> "Se um dia tiver que escolher entre o mundo e o amor... Lembre-se:
> Se escolher o mundo, ficará sem o amor, mas se escolher o amor,
> com ele conquistará o mundo." (Albert Einstein)
> ╔════════════════════════════════════════╗
> ROMERYTO VIEIRA LIRA
> Bacharelando em Ciência da Computação - UFCG
> Membro do SegHidro2 - LSD -http://seghidro.lsd.ufcg.edu.br
> Membro do Grupo de Suporte Guardians -www.lcc.ufcg.edu.br
> Página Pessoal:http://romeryto.googlepages.com
> Blog:http://olhartecnologico.blogspot.com
> ╚════════════════════════════════════════╝
>
> Pensou em imprimir este e-mail? Isto é mesmo necessário? Poupe o meio
> ambiente.
> ---------------------------------------------------------------------------
> -------------------------------------------------
>
> fileMimeTypeError.JPG
> 20KViewDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" 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-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---