Index: filegallib.php
===================================================================
--- filegallib.php	(revision 42490)
+++ filegallib.php	(working copy)
@@ -3612,39 +3612,17 @@
 	function fixMime($fileData) 
 	{
 		global $prefs;
+		global $mimetypes; include ('lib/mime/mimetypes.php');
 		if ($prefs['fgal_fix_mime_type'] != 'y') {
 			return $fileData['filetype'];
 		}
-		if ($fileData['filetype'] != "application/octet-stream") {
+		$suffix=strtolower(preg_replace('/.*\./', '', $fileData['filename']));
+		$filetype = $mimetypes[$suffix];
+		if ($filetype) {
+			return $filetype;
+		} else {
 			return $fileData['filetype'];
 		}
-		$suffix=strtolower(preg_replace('/.*\./', '', $fileData['filename']));
-		switch($suffix) {
-			case 'jpg' :
-			case 'jpeg' :	$filetype = 'image/jpeg';
-							break;
-			case 'gif' :	$filetype = 'image/gif';
-							break;
-			case 'png' :	$filetype = 'image/png';
-							break;
-			case 'tif' :
-			case 'tiff' :	$filetype = 'image/tiff';
-							break;
-			case 'svg' :	$filetype = 'image/svg+xml';
-							break;
-			case 'pdf' :	$filetype = 'application/pdf';
-							break;
-			case 'doc' :	$filetype = 'application/msword';
-							break;
-			case 'ppt' :	$filetype = 'application/vnd.ms-powerpoint';
-							break;
-			case 'xls' :	$filetype = 'application/vnd.ms-excel';
-							break;
-			case 'docx' :	$filetype = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
-							break;
-			default :		$filetype = 'application/octet-stream';
-		}
-		return $filetype;
 	}
 	
 }
