diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php index fc15de9b5c..0038ddad6d 100755 --- a/main/inc/lib/document.lib.php +++ b/main/inc/lib/document.lib.php @@ -62,176 +62,190 @@ class DocumentManager { // All MIME types in an array (from 1.6, this is the authorative source) // Please, keep this alphabetical if you add something to this list! $mime_types = array( - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'asf' => 'video/x-ms-asf', - 'asc' => 'text/plain', - 'au' => 'audio/basic', - 'avi' => 'video/x-msvideo', - 'bcpio' => 'application/x-bcpio', - 'bin' => 'application/octet-stream', - 'bmp' => 'image/bmp', - 'cdf' => 'application/x-netcdf', - 'class' => 'application/octet-stream', - 'cpio' => 'application/x-cpio', - 'cpt' => 'application/mac-compactpro', - 'csh' => 'application/x-csh', - 'css' => 'text/css', - 'dcr' => 'application/x-director', - 'dir' => 'application/x-director', - 'djv' => 'image/vnd.djvu', - 'djvu' => 'image/vnd.djvu', - 'dll' => 'application/octet-stream', - 'dmg' => 'application/x-diskcopy', - 'dms' => 'application/octet-stream', - 'doc' => 'application/msword', - 'docx'=> 'application/msword', - 'dvi' => 'application/x-dvi', - 'dwg' => 'application/vnd.dwg', - 'dxf' => 'application/vnd.dxf', - 'dxr' => 'application/x-director', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'etx' => 'text/x-setext', - 'exe' => 'application/octet-stream', - 'ez' => 'application/andrew-inset', - 'gif' => 'image/gif', - 'gtar' => 'application/x-gtar', - 'gz' => 'application/x-gzip', - 'hdf' => 'application/x-hdf', - 'hqx' => 'application/mac-binhex40', - 'htm' => 'text/html', - 'html' => 'text/html', - 'ice' => 'x-conference-xcooltalk', - 'ief' => 'image/ief', - 'iges' => 'model/iges', - 'igs' => 'model/iges', - 'jar' => 'application/java-archiver', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'js' => 'application/x-javascript', - 'kar' => 'audio/midi', - 'latex' => 'application/x-latex', - 'lha' => 'application/octet-stream', - 'log' => 'text/plain', - 'lzh' => 'application/octet-stream', - 'm1a' => 'audio/mpeg', - 'm2a' => 'audio/mpeg', - 'm3u' => 'audio/x-mpegurl', - 'man' => 'application/x-troff-man', - 'me' => 'application/x-troff-me', - 'mesh' => 'model/mesh', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mpeg4-generic', - 'mpa' => 'audio/mpeg', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpga' => 'audio/mpeg', - 'ms' => 'application/x-troff-ms', - 'msh' => 'model/mesh', - 'mxu' => 'video/vnd.mpegurl', - 'nc' => 'application/x-netcdf', - 'oda' => 'application/oda', - 'oga'=> 'audio/ogg', - 'ogg'=> 'application/ogg', - 'ogx'=> 'application/ogg', - 'ogv'=> 'video/ogg', - 'pbm' => 'image/x-portable-bitmap', - 'pct' => 'image/pict', - 'pdb' => 'chemical/x-pdb', - 'pdf' => 'application/pdf', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pict' => 'image/pict', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'ppm' => 'image/x-portable-pixmap', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx'=> 'application/vnd.ms-powerpoint', - 'pps' => 'application/vnd.ms-powerpoint', - 'ps' => 'application/postscript', - 'qt' => 'video/quicktime', - 'ra' => 'audio/x-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'rar' => 'image/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rgb' => 'image/x-rgb', - 'rm' => 'audio/x-pn-realaudio', - 'roff' => 'application/x-troff', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'rtf' => 'text/rtf', - 'rtx' => 'text/richtext', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'silo' => 'model/mesh', - 'sib' => 'application/X-Sibelius-Score', - 'sit' => 'application/x-stuffit', - 'skd' => 'application/x-koan', - 'skm' => 'application/x-koan', - 'skp' => 'application/x-koan', - 'skt' => 'application/x-koan', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'snd' => 'audio/basic', - 'so' => 'application/octet-stream', - 'spl' => 'application/x-futuresplash', - 'src' => 'application/x-wais-source', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svf' => 'application/vnd.svf', - 'svg' => 'image/svg+xml', - //'svgz' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxw' => 'application/vnd.sun.xml.writer', - 't' => 'application/x-troff', - 'tar' => 'application/x-tar', - 'tcl' => 'application/x-tcl', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'tga' => 'image/x-targa', - 'tif' => 'image/tif', - 'tiff' => 'image/tiff', - 'tr' => 'application/x-troff', - 'tsv' => 'text/tab-seperated-values', - 'txt' => 'text/plain', - 'ustar' => 'application/x-ustar', - 'vcd' => 'application/x-cdlink', - 'vrml' => 'model/vrml', - 'wav' => 'audio/x-wav', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbxml' => 'application/vnd.wap.wbxml', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wma' => 'video/x-ms-wma', - 'wmv' => 'audio/x-ms-wmv', - 'wrl' => 'model/vrml', - 'xbm' => 'image/x-xbitmap', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xls' => 'application/vnd.ms-excel', - 'xlsx' => 'application/vnd.ms-excel', - 'xml' => 'text/xml', - 'xpm' => 'image/x-xpixmap', - 'xsl' => 'text/xml', - 'xwd' => 'image/x-windowdump', - 'xyz' => 'chemical/x-xyz', - 'zip' => 'application/zip' +'ai' => 'application/postscript', +'aif' => 'audio/x-aiff', +'aifc' => 'audio/x-aiff', +'aiff' => 'audio/x-aiff', +'asf' => 'video/x-ms-asf', +'asc' => 'text/plain', +'au' => 'audio/basic', +'avi' => 'video/x-msvideo', +'bcpio' => 'application/x-bcpio', +'bin' => 'application/octet-stream', +'bmp' => 'image/bmp', +'cdf' => 'application/x-netcdf', +'class' => 'application/octet-stream', +'cpio' => 'application/x-cpio', +'cpt' => 'application/mac-compactpro', +'csh' => 'application/x-csh', +'css' => 'text/css', +'dcr' => 'application/x-director', +'dir' => 'application/x-director', +'djv' => 'image/vnd.djvu', +'djvu' => 'image/vnd.djvu', +'dll' => 'application/octet-stream', +'dmg' => 'application/x-diskcopy', +'dms' => 'application/octet-stream', +'doc' => 'application/msword', +'docm' => 'application/vnd.ms-word.document.macroEnabled.12', +'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', +'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', +'dvi' => 'application/x-dvi', +'dwg' => 'application/vnd.dwg', +'dxf' => 'application/vnd.dxf', +'dxr' => 'application/x-director', +'eps' => 'application/postscript', +'epub' => 'application/epub+zip', +'etx' => 'text/x-setext', +'exe' => 'application/octet-stream', +'ez' => 'application/andrew-inset', +'gif' => 'image/gif', +'gtar' => 'application/x-gtar', +'gz' => 'application/x-gzip', +'hdf' => 'application/x-hdf', +'hqx' => 'application/mac-binhex40', +'htm' => 'text/html', +'html' => 'text/html', +'ice' => 'x-conference-xcooltalk', +'ief' => 'image/ief', +'iges' => 'model/iges', +'igs' => 'model/iges', +'jar' => 'application/java-archiver', +'jpe' => 'image/jpeg', +'jpeg' => 'image/jpeg', +'jpg' => 'image/jpeg', +'js' => 'application/x-javascript', +'kar' => 'audio/midi', +'lam' => 'application/vnd.ms-excel.addin.macroEnabled.12', +'latex' => 'application/x-latex', +'lha' => 'application/octet-stream', +'log' => 'text/plain', +'lzh' => 'application/octet-stream', +'m1a' => 'audio/mpeg', +'m2a' => 'audio/mpeg', +'m3u' => 'audio/x-mpegurl', +'man' => 'application/x-troff-man', +'me' => 'application/x-troff-me', +'mesh' => 'model/mesh', +'mid' => 'audio/midi', +'midi' => 'audio/midi', +'mov' => 'video/quicktime', +'movie' => 'video/x-sgi-movie', +'mp2' => 'audio/mpeg', +'mp3' => 'audio/mpeg', +'mp4' => 'video/mpeg4-generic', +'mpa' => 'audio/mpeg', +'mpe' => 'video/mpeg', +'mpeg' => 'video/mpeg', +'mpg' => 'video/mpeg', +'mpga' => 'audio/mpeg', +'ms' => 'application/x-troff-ms', +'msh' => 'model/mesh', +'mxu' => 'video/vnd.mpegurl', +'nc' => 'application/x-netcdf', +'oda' => 'application/oda', +'oga'=> 'audio/ogg', +'ogg'=> 'application/ogg', +'ogx'=> 'application/ogg', +'ogv'=> 'video/ogg', +'pbm' => 'image/x-portable-bitmap', +'pct' => 'image/pict', +'pdb' => 'chemical/x-pdb', +'pdf' => 'application/pdf', +'pgm' => 'image/x-portable-graymap', +'pgn' => 'application/x-chess-pgn', +'pict' => 'image/pict', +'png' => 'image/png', +'pnm' => 'image/x-portable-anymap', +'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', +'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', +'pps' => 'application/vnd.ms-powerpoint', +'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', +'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', +'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', +'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', +'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', +'ppm' => 'image/x-portable-pixmap', +'ppt' => 'application/vnd.ms-powerpoint', +'pps' => 'application/vnd.ms-powerpoint', +'ps' => 'application/postscript', +'qt' => 'video/quicktime', +'ra' => 'audio/x-realaudio', +'ram' => 'audio/x-pn-realaudio', +'rar' => 'image/x-rar-compressed', +'ras' => 'image/x-cmu-raster', +'rgb' => 'image/x-rgb', +'rm' => 'audio/x-pn-realaudio', +'roff' => 'application/x-troff', +'rpm' => 'audio/x-pn-realaudio-plugin', +'rtf' => 'text/rtf', +'rtx' => 'text/richtext', +'sgm' => 'text/sgml', +'sgml' => 'text/sgml', +'sh' => 'application/x-sh', +'shar' => 'application/x-shar', +'silo' => 'model/mesh', +'sib' => 'application/X-Sibelius-Score', +'sit' => 'application/x-stuffit', +'skd' => 'application/x-koan', +'skm' => 'application/x-koan', +'skp' => 'application/x-koan', +'skt' => 'application/x-koan', +'smi' => 'application/smil', +'smil' => 'application/smil', +'snd' => 'audio/basic', +'so' => 'application/octet-stream', +'spl' => 'application/x-futuresplash', +'src' => 'application/x-wais-source', +'sv4cpio' => 'application/x-sv4cpio', +'sv4crc' => 'application/x-sv4crc', +'svf' => 'application/vnd.svf', +'svg' => 'image/svg+xml', +//'svgz' => 'image/svg+xml', +'swf' => 'application/x-shockwave-flash', +'sxc' => 'application/vnd.sun.xml.calc', +'sxi' => 'application/vnd.sun.xml.impress', +'sxw' => 'application/vnd.sun.xml.writer', +'t' => 'application/x-troff', +'tar' => 'application/x-tar', +'tcl' => 'application/x-tcl', +'tex' => 'application/x-tex', +'texi' => 'application/x-texinfo', +'texinfo' => 'application/x-texinfo', +'tga' => 'image/x-targa', +'tif' => 'image/tif', +'tiff' => 'image/tiff', +'tr' => 'application/x-troff', +'tsv' => 'text/tab-seperated-values', +'txt' => 'text/plain', +'ustar' => 'application/x-ustar', +'vcd' => 'application/x-cdlink', +'vrml' => 'model/vrml', +'wav' => 'audio/x-wav', +'wbmp' => 'image/vnd.wap.wbmp', +'wbxml' => 'application/vnd.wap.wbxml', +'wml' => 'text/vnd.wap.wml', +'wmlc' => 'application/vnd.wap.wmlc', +'wmls' => 'text/vnd.wap.wmlscript', +'wmlsc' => 'application/vnd.wap.wmlscriptc', +'wma' => 'video/x-ms-wma', +'wmv' => 'audio/x-ms-wmv', +'wrl' => 'model/vrml', +'xbm' => 'image/x-xbitmap', +'xht' => 'application/xhtml+xml', +'xhtml' => 'application/xhtml+xml', +'xls' => 'application/vnd.ms-excel', +'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', +'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', +'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', +'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', +'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', +'xml' => 'text/xml', +'xpm' => 'image/x-xpixmap', +'xsl' => 'text/xml', +'xwd' => 'image/x-windowdump', +'xyz' => 'chemical/x-xyz', +'zip' => 'application/zip' ); if ($filename === true) {