Index: openacs-4/packages/acs-tcl/tcl/defs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/defs-procs.tcl,v diff -u -r1.54 -r1.55 --- openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 10 Jan 2007 21:22:12 -0000 1.54 +++ openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 15 Jan 2007 06:56:11 -0000 1.55 @@ -364,6 +364,22 @@ " } +ad_proc -public ad_return_string_as_file { + -string + -filename + -mime_type +} { + Return a string as the content of a file + + @param string Content of the file to be sent back + @param filename Name of the file to be returned + @param mime_type Mime Type of the file being returned +} { + ns_set put [ns_conn outputheaders] "Content-Disposition" "attachment; filename=\"$filename\"" + ReturnHeaders "$mime_type" + ns_write $string +} + ad_proc -public ad_return_complaint { exception_count exception_text