tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ran Harpaz <>
Subject Re: CSV File "Save as" dialogue defaults to HTM file
Date Mon, 25 Jan 2010 18:04:18 GMT

Alessandro Bahgat wrote:
> On Mon, Jan 25, 2010 at 11:02 AM, Pid <> wrote:
>> On 25/01/2010 09:17, Ran Harpaz wrote:
>>> Hello, I'm using Jetspeed 1.6, running on Tomcat.
>>> In a portlet I developed, I create a .csv file and print a link to it.
>>> The
>>> user then needs to right-click on the file and select "save file as".
>>> The dialogue that pops up defaults to file type HTML file, and replaces
>>> the
>>> .csv extension of the file I link to with .htm.
>>> Is there anyway to resolve this? I really need to give access to the csv
>>> file as-is, and not bother my clients more than neccessary.
>> Are you setting the "Content-type" header to "text/csv", or are you just
>> generating it with a JSP?
>> The latter will automatically set text/html as the content type.
> You may also want to change the content-disposition header in order to
> make your server prompt the user with the "save as" dialog:
> For example,
> response.setHeader("Content-disposition",
>                   "attachment; filename=" +
>                   defaultCsvFilename );
> Regards,
> Alessandro
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Thank you, but this solution doesn't seem to work on Jetspeed, due to the
fact that I'm running JSR-168 Portlets on it. I don't believe they support
changing the response's ContentType.

I wanted to know if there was anything about the Tomcat platform that could
result in a CSV file defaulting to an HTM file, and if there was anything to
do about it.
View this message in context:
Sent from the Tomcat - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message