Index: branches/5.2.x/core/kernel/globals.php =================================================================== diff -u -N -r15725 -r15733 --- branches/5.2.x/core/kernel/globals.php (.../globals.php) (revision 15725) +++ branches/5.2.x/core/kernel/globals.php (.../globals.php) (revision 15733) @@ -1,6 +1,6 @@ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', @@ -636,7 +636,7 @@ */ public static function mimeContentTypeByExtension($file) { - $file_extension = mb_strtolower( pathinfo($file, PATHINFO_EXTENSION) ); + $file_extension = mb_strtolower(pathinfo(self::removeTempExtension($file), PATHINFO_EXTENSION)); $mapping = '(xls:application/excel)(hqx:application/macbinhex40)(doc,dot,wrd:application/msword)(pdf:application/pdf) (pgp:application/pgp)(ps,eps,ai:application/postscript)(ppt:application/powerpoint)(rtf:application/rtf) @@ -662,6 +662,19 @@ } /** + * Strips ".tmp" suffix (added by flash uploader) from a filename + * + * @param string $file + * @return string + * @access public + * @static + */ + public static function removeTempExtension($file) + { + return preg_replace('/(_[\d]+)?\.tmp$/', '', $file); + } + + /** * Return param value and removes it from params array * * @param string $name