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 -r1.69.2.2 -r1.69.2.3 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 2 Jan 2016 20:13:30 -0000 1.69.2.2 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 27 Oct 2016 18:02:00 -0000 1.69.2.3 @@ -752,9 +752,15 @@ set indbp "f" set storage_type "file" } - if {$mime_type eq ""} { - set mime_type [cr_filename_to_mime_type -create -- $name] - } + + # This check also happens in content repository, but as something + # similar was already here and mimetype coming from this was used + # afterwards, we kept this behavior. + set mime_type [cr_check_mime_type \ + -filename $name \ + -mime_type $mime_type \ + -file $tmp_filename] + # we have to do this here because we create the object before # calling cr_import_content @@ -1030,10 +1036,15 @@ if {$storage_type eq ""} { set storage_type [db_string get_storage_type {}] } - if {$mime_type eq ""} { - set mime_type [cr_filename_to_mime_type -create -- $name] - } + # This check also happens in content repository, but as something + # similar was already here and mimetype coming from this was used + # afterwards, we kept this behavior. + set mime_type [cr_check_mime_type \ + -filename $name \ + -mime_type $mime_type \ + -file $tmp_filename] + set tmp_size [file size $tmp_filename] set parent_id [fs::get_parent -item_id $item_id] set revision_id [cr_import_content \