The URLEncoder seems to make the filename look even messier. Should I use a specific character encoding?

--Martin

On Tue, 29 Nov 2005 18:13:44 +0100, Patrick Casey <[EMAIL PROTECTED]> wrote:

        Did you try:

        String foo = ("Content-disposition", "attachment; filename=\""
+ filename + "\"";

        String bar = java.net.URLEncoder.encode(foo);
        Reponse.setHeader(bar);

        --- Pat

-----Original Message-----
From: Martin Strand [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 29, 2005 8:37 AM
To: tapestry-user@jakarta.apache.org
Subject: Encode filename in http header

I've written a download service where I set the filename like this:

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

It appears I have to encode non-ascii characters somehow, how do I do
that?

--Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to