Index: openacs-4/packages/file-storage/tcl/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.tcl,v diff -u -N -r1.61 -r1.62 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 15 Jun 2007 17:40:28 -0000 1.61 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 17 Jul 2007 02:57:10 -0000 1.62 @@ -579,7 +579,7 @@ db_1row select_object_metadata {} if {[empty_string_p $file_name]} { - set file_name $label + set file_name $name } set file_name "${file_name}.url" set file_name [remove_special_file_system_characters -string $file_name] @@ -617,6 +617,13 @@ } else { set file_name $file_upload_name } + } elseif { [item::get_mime_info [item::get_live_revision $object_id]] } { + # We make sure that the file_name contains the file + # extension at the end so that the users default + # application for that file type can be used + if { ![regexp "\.$mime_info(file_extension)$" $file_name match] } { + set file_name "${file_name}.$mime_info(file_extension)" + } } } else { set file_name $file_upload_name @@ -1210,7 +1217,7 @@ set url "[ad_url]" set new_content "" - db_1row get_owner_name { } + db_0or1row get_owner_name { } if {[string equal $action "new_file"] || [string equal $action "new_url"] || [string equal $action "new_version"]} {