Just ran it out of curiosity here on a tomcat 5.5.17, works perfectly. Only noticeable thing is that the first file get slowed down when you start second file, but it's quite to be excpected. Measured speed: 6M/s, files are not mixed together

One thing worth noticing, is that brtowser do this here
- get the header telling 'content type and save to disk'
- show the save as dialog prompt
- request again file from server

This result in file being generated twice and the fact fileXXXXX.xls has content of fileYYYYYY.xls

password password wrote:
I have this JSP that download an excel file. It works fine if I use only one browser at the same time. The problem is when I try to do this but from 2 browsers at the same time, (for example in a same computer). From each browser I can download a part of the file but not the complete file. It seems the browsers are sharing the bandwidth and when it starts to download a file the other stops. I have look the logs, and I saw the file has downloaded to the computer and while the jsp is working. I don't undestand why the file has finished to download and while the jsp is still executing. Can you help me please? do anybody try this JSP and tell me if the result is the same as me? Why is it happening this? ------------------------------------------JSP ---------------------------------------------------------------------------&shy;-------- <[EMAIL PROTECTED] contentType="application/vnd.ms-excel"%> <%@ page language="java" import="java.io.*"%> <%@ page language="java" import="java.util.*"%> <% Date fecha = new Date(); java.sql.Date fechaSQL = new java.sql.Date(fecha.getTime()); Calendar calendario = Calendar.getInstance(); calendario.setTime(fecha); // fecha es el Date de antes. String strHour = String.valueOf( calendario.get(Calendar.HOUR) ); String strMinute = String.valueOf( calendario.get(Calendar.MINUTE) ); String strSecond = String.valueOf( calendario.get(Calendar.SECOND) ); String nombre = "FILE" + strHour + strMinute + strSecond + ".xls"; System.out.println( " IN OF " + nombre ); response.setContentType( "application/x-download" ); response.setHeader("Content-type","application/vnd.ms-excel"); response.setHeader("Content-Disposition","attachment; filename=\"" + nombre + "\""); System.out.println( nombre + " START" ); for (int l=0;l<30000;l++){ System.out.println( nombre + " " + l ); for (int k=0;k<250;k++){ out.write(nombre + " : ("+ l + "," + k + ")" + "\t" ); } out.write("\n"); }

System.out.println( nombre + " END" ); %>


                
---------------------------------

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to