tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Umar Zubair" <>
Subject Downloadable file name is not correct on Linux/Unix box
Date Thu, 19 Oct 2006 06:49:33 GMT
I am using Tomcat5.5. I have a jsp page with option to download xls and pdf
files. When I click the link to download file and try to save it, I can not
see the exact file name. It shows the jsp file name.

By the way, if I run same application on windows box, it works perfect. I am
using following line of code in jsp page.


String filename = "summaryReport.xls"


    response.setHeader("Content-Disposition", "attachment; filename=" +

    // Open the output stream

    OutputStream outS = response.getOutputStream();

    // Transfer bytes from the ZIP file to the output file

    byte[] buf = new byte[1024];

    int len;

    while ((len = > 0) {

        outS.write(buf, 0, len);





Instead of showing summaryReport.xls, system shows jsp file name.


Umar Zubair


NOTE: This communication is intended for the above named person and is
confidential and / or legally privileged. Any opinion(s) expressed in this
communication are not necessarily those of Total Technologies and Solutions
FZ-LLC. If this eMail has come to you in error you must take no action based
upon it, nor must you print it, copy it, forward it, or show it to anyone.
Please delete and destroy this eMail and any attachments and inform the
sender immediately. 

Since the integrity and security of this message cannot be fully guaranteed
on the Internet, we strongly advise that you understand and observe this
lack of security when eMailing us. Total Technologies and Solutions FZ-LLC
is not responsible for the political, religious, racial or partisan opinion
in any correspondence conducted by its domain users. Therefore, any such
opinion expressed, whether explicitly or implicitly implied is not to be
interpreted as that of Total Technologies and Solutions FZ-LLC. 

Although Total Technologies and Solutions FZ-LLC has taken steps to ensure
that all our eMails and attachments are free from any virus, we advise that,
in keeping with best business practices, the recipient must ensure they are
actually virus free. 


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message