Index: openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl,v diff -u -r1.51 -r1.52 --- openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 22 Oct 2011 22:12:47 -0000 1.51 +++ openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 22 Mar 2012 10:42:23 -0000 1.52 @@ -197,6 +197,13 @@ namespace eval ::xo { # + # Escape provided char in provided string with backslash + # + proc backslash_escape {char string} { + return [string map [list $char \\$char] $string] + } + + # # Localization # @@ -424,7 +431,8 @@ #ns_return 200 text/plain $output my instvar name if {![my exists name]} {set name "table"} - ns_set put [ns_conn outputheaders] Content-Disposition "attachment;filename=$name.csv" + set fn [xo::backslash_escape \" $name.csv] + ns_set put [ns_conn outputheaders] Content-Disposition "attachment;filename=\"$fn\"" ns_return 200 text/csv $output }