users@jersey.java.net

[Jersey] Re: jersey resource returning a csv file, how to change the name of the file instead of using the url?

From: Conal Tuohy <conal.tuohy_at_versi.edu.au>
Date: Wed, 12 Jan 2011 11:38:06 +1100

Add a "Content-disposition" HTTP header, e.g.

Content-disposition: attachment; filename=fname.ext

On 11/01/11 08:20, chauzer wrote:
> i have a jersey resource that returns a csv file (or any other type of file)
> for the user to download. but the filename doesnt have an extension though.
> for example if the url is www.google.com/1000, the file to be downloaded
> will have the filename "1000" and i set the MIME type to application/csv. Is
> there a way I can have the resource return a different file name? i.e.
> "test.csv"?
>
> thanks


-- 
Conal Tuohy
eResearch Business Analyst
Victorian eResearch Strategic Initiative
+61-466324297