You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
9.8 KiB

7 years ago
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. /*
  4. | -------------------------------------------------------------------
  5. | MIME TYPES
  6. | -------------------------------------------------------------------
  7. | This file contains an array of mime types. It is used by the
  8. | Upload class to help identify allowed file types.
  9. |
  10. */
  11. return array(
  12. 'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
  13. 'cpt' => 'application/mac-compactpro',
  14. 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
  15. 'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
  16. 'dms' => 'application/octet-stream',
  17. 'lha' => 'application/octet-stream',
  18. 'lzh' => 'application/octet-stream',
  19. 'exe' => array('application/octet-stream', 'application/x-msdownload'),
  20. 'class' => 'application/octet-stream',
  21. 'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
  22. 'so' => 'application/octet-stream',
  23. 'sea' => 'application/octet-stream',
  24. 'dll' => 'application/octet-stream',
  25. 'oda' => 'application/oda',
  26. 'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
  27. 'ai' => array('application/pdf', 'application/postscript'),
  28. 'eps' => 'application/postscript',
  29. 'ps' => 'application/postscript',
  30. 'smi' => 'application/smil',
  31. 'smil' => 'application/smil',
  32. 'mif' => 'application/vnd.mif',
  33. 'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
  34. 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
  35. 'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
  36. 'wbxml' => 'application/wbxml',
  37. 'wmlc' => 'application/wmlc',
  38. 'dcr' => 'application/x-director',
  39. 'dir' => 'application/x-director',
  40. 'dxr' => 'application/x-director',
  41. 'dvi' => 'application/x-dvi',
  42. 'gtar' => 'application/x-gtar',
  43. 'gz' => 'application/x-gzip',
  44. 'gzip' => 'application/x-gzip',
  45. 'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
  46. 'php4' => 'application/x-httpd-php',
  47. 'php3' => 'application/x-httpd-php',
  48. 'phtml' => 'application/x-httpd-php',
  49. 'phps' => 'application/x-httpd-php-source',
  50. 'js' => array('application/x-javascript', 'text/plain'),
  51. 'swf' => 'application/x-shockwave-flash',
  52. 'sit' => 'application/x-stuffit',
  53. 'tar' => 'application/x-tar',
  54. 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
  55. 'z' => 'application/x-compress',
  56. 'xhtml' => 'application/xhtml+xml',
  57. 'xht' => 'application/xhtml+xml',
  58. 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
  59. 'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
  60. 'mid' => 'audio/midi',
  61. 'midi' => 'audio/midi',
  62. 'mpga' => 'audio/mpeg',
  63. 'mp2' => 'audio/mpeg',
  64. 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
  65. 'aif' => array('audio/x-aiff', 'audio/aiff'),
  66. 'aiff' => array('audio/x-aiff', 'audio/aiff'),
  67. 'aifc' => 'audio/x-aiff',
  68. 'ram' => 'audio/x-pn-realaudio',
  69. 'rm' => 'audio/x-pn-realaudio',
  70. 'rpm' => 'audio/x-pn-realaudio-plugin',
  71. 'ra' => 'audio/x-realaudio',
  72. 'rv' => 'video/vnd.rn-realvideo',
  73. 'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
  74. 'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
  75. 'gif' => 'image/gif',
  76. 'jpeg' => array('image/jpeg', 'image/pjpeg'),
  77. 'jpg' => array('image/jpeg', 'image/pjpeg'),
  78. 'jpe' => array('image/jpeg', 'image/pjpeg'),
  79. 'jp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
  80. 'j2k' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
  81. 'jpf' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
  82. 'jpg2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
  83. 'jpx' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
  84. 'jpm' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
  85. 'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
  86. 'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
  87. 'png' => array('image/png', 'image/x-png'),
  88. 'tiff' => 'image/tiff',
  89. 'tif' => 'image/tiff',
  90. 'css' => array('text/css', 'text/plain'),
  91. 'html' => array('text/html', 'text/plain'),
  92. 'htm' => array('text/html', 'text/plain'),
  93. 'shtml' => array('text/html', 'text/plain'),
  94. 'txt' => 'text/plain',
  95. 'text' => 'text/plain',
  96. 'log' => array('text/plain', 'text/x-log'),
  97. 'rtx' => 'text/richtext',
  98. 'rtf' => 'text/rtf',
  99. 'xml' => array('application/xml', 'text/xml', 'text/plain'),
  100. 'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
  101. 'mpeg' => 'video/mpeg',
  102. 'mpg' => 'video/mpeg',
  103. 'mpe' => 'video/mpeg',
  104. 'qt' => 'video/quicktime',
  105. 'mov' => 'video/quicktime',
  106. 'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
  107. 'movie' => 'video/x-sgi-movie',
  108. 'doc' => array('application/msword', 'application/vnd.ms-office'),
  109. 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
  110. 'dot' => array('application/msword', 'application/vnd.ms-office'),
  111. 'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
  112. 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
  113. 'word' => array('application/msword', 'application/octet-stream'),
  114. 'xl' => 'application/excel',
  115. 'eml' => 'message/rfc822',
  116. 'json' => array('application/json', 'text/json'),
  117. 'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
  118. 'p10' => array('application/x-pkcs10', 'application/pkcs10'),
  119. 'p12' => 'application/x-pkcs12',
  120. 'p7a' => 'application/x-pkcs7-signature',
  121. 'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
  122. 'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
  123. 'p7r' => 'application/x-pkcs7-certreqresp',
  124. 'p7s' => 'application/pkcs7-signature',
  125. 'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
  126. 'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
  127. 'der' => 'application/x-x509-ca-cert',
  128. 'kdb' => 'application/octet-stream',
  129. 'pgp' => 'application/pgp',
  130. 'gpg' => 'application/gpg-keys',
  131. 'sst' => 'application/octet-stream',
  132. 'csr' => 'application/octet-stream',
  133. 'rsa' => 'application/x-pkcs7',
  134. 'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
  135. '3g2' => 'video/3gpp2',
  136. '3gp' => array('video/3gp', 'video/3gpp'),
  137. 'mp4' => 'video/mp4',
  138. 'm4a' => 'audio/x-m4a',
  139. 'f4v' => array('video/mp4', 'video/x-f4v'),
  140. 'flv' => 'video/x-flv',
  141. 'webm' => 'video/webm',
  142. 'aac' => 'audio/x-acc',
  143. 'm4u' => 'application/vnd.mpegurl',
  144. 'm3u' => 'text/plain',
  145. 'xspf' => 'application/xspf+xml',
  146. 'vlc' => 'application/videolan',
  147. 'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
  148. 'au' => 'audio/x-au',
  149. 'ac3' => 'audio/ac3',
  150. 'flac' => 'audio/x-flac',
  151. 'ogg' => array('audio/ogg', 'video/ogg', 'application/ogg'),
  152. 'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
  153. 'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
  154. 'ics' => 'text/calendar',
  155. 'ical' => 'text/calendar',
  156. 'zsh' => 'text/x-scriptzsh',
  157. '7zip' => array('application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
  158. 'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
  159. 'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
  160. 'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
  161. 'svg' => array('image/svg+xml', 'application/xml', 'text/xml'),
  162. 'vcf' => 'text/x-vcard',
  163. 'srt' => array('text/srt', 'text/plain'),
  164. 'vtt' => array('text/vtt', 'text/plain'),
  165. 'ico' => array('image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'),
  166. 'odc' => 'application/vnd.oasis.opendocument.chart',
  167. 'otc' => 'application/vnd.oasis.opendocument.chart-template',
  168. 'odf' => 'application/vnd.oasis.opendocument.formula',
  169. 'otf' => 'application/vnd.oasis.opendocument.formula-template',
  170. 'odg' => 'application/vnd.oasis.opendocument.graphics',
  171. 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
  172. 'odi' => 'application/vnd.oasis.opendocument.image',
  173. 'oti' => 'application/vnd.oasis.opendocument.image-template',
  174. 'odp' => 'application/vnd.oasis.opendocument.presentation',
  175. 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
  176. 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
  177. 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
  178. 'odt' => 'application/vnd.oasis.opendocument.text',
  179. 'odm' => 'application/vnd.oasis.opendocument.text-master',
  180. 'ott' => 'application/vnd.oasis.opendocument.text-template',
  181. 'oth' => 'application/vnd.oasis.opendocument.text-web'
  182. );