Yes I tried it. But it did not work.

Umar

-----Original Message-----
From: Michael Courcy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 19, 2006 2:16 PM
To: Tomcat Users List
Subject: Re: Downloadable file name is not correct on Linux/Unix box

Did you try to add the mime type in your header ?
Content-Type: application/octet-stream

Mic


Umar Zubair a écrit :
> 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=" +
> 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 = in.read(buf)) > 0) {
>
>         outS.write(buf, 0, len);
>
>         //out.wr
>
>     }
>
>     outS.close();
>
>  
>
> Instead of showing summaryReport.xls, system shows jsp file name.
>
> Regards,
>
> 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. 
>
>  
>
>
>   


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



---------------------------------------------------------------------
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