You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Marty Phee <mp...@jump-technologies.com> on 2005/03/03 18:17:10 UTC

Response file name

I've got a RawScreen that sends back an Excel spreadsheet.  The file 
coming back is the name of the servlet, ExcelExport.xls.  This causes a 
problem with IE.  I really need it to come back as different names like 
ExcelExport1.xls, ExcelExport2.xls...

What's the best way to do this?

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Response file name

Posted by Marty Phee <mp...@jump-technologies.com>.
Thanks, that's the way I ended up doing it.  Originally I wanted them to 
open in different browsers, but I think it's better to have the open 
directly in Excel so I added" attachement" to it.


Steve Yokanovich wrote:
> This is what I use that seems to work fine in IE:
> 
> data.getResponse().setHeader("Content-disposition", "filename=" + 
> "filename.csv");
> 
> Hope this works for you.
> 
> Marty Phee wrote:
> 
>> I've got a RawScreen that sends back an Excel spreadsheet.  The file 
>> coming back is the name of the servlet, ExcelExport.xls.  This causes 
>> a problem with IE.  I really need it to come back as different names 
>> like ExcelExport1.xls, ExcelExport2.xls...
>>
>> What's the best way to do this?


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Response file name

Posted by Steve Yokanovich <sy...@smythco.com>.
This is what I use that seems to work fine in IE:

data.getResponse().setHeader("Content-disposition", "filename=" + 
"filename.csv");

Hope this works for you.

Marty Phee wrote:

> I've got a RawScreen that sends back an Excel spreadsheet.  The file 
> coming back is the name of the servlet, ExcelExport.xls.  This causes a 
> problem with IE.  I really need it to come back as different names like 
> ExcelExport1.xls, ExcelExport2.xls...
> 
> What's the best way to do this?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Response file name

Posted by Daniel <da...@yorku.ca>.
Hi,

This is what you need:

response.setHeader("Content-disposition",
	"attachment; filename=\""+downloadFilename+"\"");

You should also set the content type:

response.setContentType(contentType);

Regards,
Daniel

On Thu, 3 Mar 2005, Marty Phee wrote:

> I've got a RawScreen that sends back an Excel spreadsheet.  The file
> coming back is the name of the servlet, ExcelExport.xls.  This causes a
> problem with IE.  I really need it to come back as different names like
> ExcelExport1.xls, ExcelExport2.xls...
>
> What's the best way to do this?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org