Index: openacs-4/packages/attachments/www/go-to-attachment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/go-to-attachment.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/attachments/www/go-to-attachment.tcl 23 Aug 2006 13:12:58 -0000 1.8 +++ openacs-4/packages/attachments/www/go-to-attachment.tcl 15 May 2007 20:14:19 -0000 1.9 @@ -32,6 +32,15 @@ } else { set filename $name } + + # Test if the filename contains the extension, otherwise append it + # This usually happens if you just rename the title (displayed filename) but forget + # to append the extension to it. + set extension [file extension $filename] + if {$extension ne $file_extension} { + append filename ".${file_extension}" + } + ad_returnredirect "download/[ad_urlencode $filename]?object_id=$object_id&attachment_id=$attachment_id" ad_script_abort return