File download - file name with spaces

I use the resp.setHeader("Content-disposition", "attachment; filename="+filename) method. it works. However, when the file name contains spaces the dowloaded file's name is only the part of the string up to the space, nothing more. Is there a way to deal with it? I'm replacing spaces for '_' at the moment but that's not exactly what I want.

Thanks.

[368 byte] By [szczypiora] at [2007-11-26 15:07:27]
# 1
Try replacing spaces by %20
BalusCa at 2007-7-8 8:57:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
It doesn't help. i tried this, and and resp.urlEncode, and still nothing. Is it possible in the first place, to have a header with spaces?Thanks for your interest.
szczypiora at 2007-7-8 8:57:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Is the filename put in between quotes?resp.setHeader("Content-disposition", "attachment; filename=\"" + filename + "\"")
BalusCa at 2007-7-8 8:57:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
So simple, but it works! Thanks!
szczypiora at 2007-7-8 8:57:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...