There was a time when commas in an attachment file name were not removed. When such a file is retrieved by the viewfile script, Google Chrome (at least some verisons of it) refuses to load it while IE, Safari, and Firefox have no problem. This is caused by Chrome's peculiar way of handling the Content-Disposition response header field. Considering the ease of workaround and the benefit, this should be addressed.
There are two ways to deal with a comma in a file name in Content-Disposition - encode the comma (%2c) or quoting the entire file name (filename="filename.ext"). As far as I tested, both work fine with IE7/9, Firefox, and Chrome.
If a comma is replaced with %2c, Firefox and Chrome recognize it literally not as a comma. On those browsers, when you save an attachment as a file, file%2cname.ext is suggested as the file name instead of file,name.ext.
So the latter approach is desirable.
And file name quoting will happen only if the file name contains something other than letters, digits, underscore, hyphen, or period.
TWiki removes commas in an attachment file name when it's attached. So this change doesn't affect newly uploaded files.
--
TWiki:Main/HideyoImazu
- 2013-05-22