PageRenderTime 52ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/app/code/core/Mage/Downloadable/Helper/File.php

https://bitbucket.org/sunil_nextbits/magento2
PHP | 779 lines | 635 code | 78 blank | 66 comment | 9 complexity | 828780b62580fd9bb708aaaddeffa8bf MD5 | raw file
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category Mage
  22. * @package Mage_Downloadable
  23. * @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
  24. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  25. */
  26. /**
  27. * Downloadable Products File Helper
  28. *
  29. * @category Mage
  30. * @package Mage_Downloadable
  31. * @author Magento Core Team <core@magentocommerce.com>
  32. */
  33. class Mage_Downloadable_Helper_File extends Mage_Core_Helper_Abstract
  34. {
  35. public function __construct()
  36. {
  37. $nodes = Mage::getConfig()->getNode('global/mime/types');
  38. if ($nodes) {
  39. $nodes = (array)$nodes;
  40. foreach ($nodes as $key => $value) {
  41. self::$_mimeTypes[$key] = $value;
  42. }
  43. }
  44. }
  45. /**
  46. * Checking file for moving and move it
  47. *
  48. * @param string $baseTmpPath
  49. * @param string $basePath
  50. * @param array $file
  51. * @return string
  52. */
  53. public function moveFileFromTmp($baseTmpPath, $basePath, $file)
  54. {
  55. if (isset($file[0])) {
  56. $fileName = $file[0]['file'];
  57. if ($file[0]['status'] == 'new') {
  58. try {
  59. $fileName = $this->_moveFileFromTmp(
  60. $baseTmpPath, $basePath, $file[0]['file']
  61. );
  62. } catch (Exception $e) {
  63. Mage::throwException(Mage::helper('Mage_Downloadable_Helper_Data')->__('An error occurred while saving the file(s).'));
  64. }
  65. }
  66. return $fileName;
  67. }
  68. return '';
  69. }
  70. /**
  71. * Move file from tmp path to base path
  72. *
  73. * @param string $baseTmpPath
  74. * @param string $basePath
  75. * @param string $file
  76. * @return string
  77. */
  78. protected function _moveFileFromTmp($baseTmpPath, $basePath, $file)
  79. {
  80. $ioObject = new Varien_Io_File();
  81. $destDirectory = dirname($this->getFilePath($basePath, $file));
  82. try {
  83. $ioObject->open(array('path'=>$destDirectory));
  84. } catch (Exception $e) {
  85. $ioObject->mkdir($destDirectory, 0777, true);
  86. $ioObject->open(array('path'=>$destDirectory));
  87. }
  88. if (strrpos($file, '.tmp') == strlen($file)-4) {
  89. $file = substr($file, 0, strlen($file)-4);
  90. }
  91. $destFile = dirname($file) . $ioObject->dirsep()
  92. . Mage_Core_Model_File_Uploader::getNewFileName($this->getFilePath($basePath, $file));
  93. Mage::helper('Mage_Core_Helper_File_Storage_Database')->copyFile(
  94. $this->getFilePath($baseTmpPath, $file),
  95. $this->getFilePath($basePath, $destFile)
  96. );
  97. $result = $ioObject->mv(
  98. $this->getFilePath($baseTmpPath, $file),
  99. $this->getFilePath($basePath, $destFile)
  100. );
  101. return str_replace($ioObject->dirsep(), '/', $destFile);
  102. }
  103. /**
  104. * Return full path to file
  105. *
  106. * @param string $path
  107. * @param string $file
  108. * @return string
  109. */
  110. public function getFilePath($path, $file)
  111. {
  112. $file = $this->_prepareFileForPath($file);
  113. if(substr($file, 0, 1) == DS) {
  114. return $path . DS . substr($file, 1);
  115. }
  116. return $path . DS . $file;
  117. }
  118. /**
  119. * Replace slashes with directory separator
  120. *
  121. * @param string $file
  122. * @return string
  123. */
  124. protected function _prepareFileForPath($file)
  125. {
  126. return str_replace('/', DS, $file);
  127. }
  128. /**
  129. * Return file name form file path
  130. *
  131. * @param string $pathFile
  132. * @return string
  133. */
  134. public function getFileFromPathFile($pathFile)
  135. {
  136. $file = '';
  137. $file = substr($pathFile, strrpos($this->_prepareFileForPath($pathFile), DS)+1);
  138. return $file;
  139. }
  140. public function getFileType($filePath)
  141. {
  142. $ext = substr($filePath, strrpos($filePath, '.')+1);
  143. return $this->_getFileTypeByExt($ext);
  144. }
  145. protected function _getFileTypeByExt($ext)
  146. {
  147. $type = 'x' . $ext;
  148. if (isset(self::$_mimeTypes[$type])) {
  149. return self::$_mimeTypes[$type];
  150. }
  151. return 'application/octet-stream';
  152. }
  153. public function getAllFileTypes()
  154. {
  155. return array_values(self::getAllMineTypes());
  156. }
  157. public function getAllMineTypes()
  158. {
  159. return self::$_mimeTypes;
  160. }
  161. protected static $_mimeTypes =
  162. array(
  163. 'x123' => 'application/vnd.lotus-1-2-3',
  164. 'x3dml' => 'text/vnd.in3d.3dml',
  165. 'x3g2' => 'video/3gpp2',
  166. 'x3gp' => 'video/3gpp',
  167. 'xace' => 'application/x-ace-compressed',
  168. 'xacu' => 'application/vnd.acucobol',
  169. 'xaep' => 'application/vnd.audiograph',
  170. 'xai' => 'application/postscript',
  171. 'xaif' => 'audio/x-aiff',
  172. 'xaifc' => 'audio/x-aiff',
  173. 'xaiff' => 'audio/x-aiff',
  174. 'xami' => 'application/vnd.amiga.ami',
  175. 'xapr' => 'application/vnd.lotus-approach',
  176. 'xasf' => 'video/x-ms-asf',
  177. 'xaso' => 'application/vnd.accpac.simply.aso',
  178. 'xasx' => 'video/x-ms-asf',
  179. 'xatom' => 'application/atom+xml',
  180. 'xatomcat' => 'application/atomcat+xml',
  181. 'xatomsvc' => 'application/atomsvc+xml',
  182. 'xatx' => 'application/vnd.antix.game-component',
  183. 'xau' => 'audio/basic',
  184. 'xavi' => 'video/x-msvideo',
  185. 'xbat' => 'application/x-msdownload',
  186. 'xbcpio' => 'application/x-bcpio',
  187. 'xbdm' => 'application/vnd.syncml.dm+wbxml',
  188. 'xbh2' => 'application/vnd.fujitsu.oasysprs',
  189. 'xbmi' => 'application/vnd.bmi',
  190. 'xbmp' => 'image/bmp',
  191. 'xbox' => 'application/vnd.previewsystems.box',
  192. 'xboz' => 'application/x-bzip2',
  193. 'xbtif' => 'image/prs.btif',
  194. 'xbz' => 'application/x-bzip',
  195. 'xbz2' => 'application/x-bzip2',
  196. 'xcab' => 'application/vnd.ms-cab-compressed',
  197. 'xccxml' => 'application/ccxml+xml',
  198. 'xcdbcmsg' => 'application/vnd.contact.cmsg',
  199. 'xcdkey' => 'application/vnd.mediastation.cdkey',
  200. 'xcdx' => 'chemical/x-cdx',
  201. 'xcdxml' => 'application/vnd.chemdraw+xml',
  202. 'xcdy' => 'application/vnd.cinderella',
  203. 'xcer' => 'application/pkix-cert',
  204. 'xcgm' => 'image/cgm',
  205. 'xchat' => 'application/x-chat',
  206. 'xchm' => 'application/vnd.ms-htmlhelp',
  207. 'xchrt' => 'application/vnd.kde.kchart',
  208. 'xcif' => 'chemical/x-cif',
  209. 'xcii' => 'application/vnd.anser-web-certificate-issue-initiation',
  210. 'xcil' => 'application/vnd.ms-artgalry',
  211. 'xcla' => 'application/vnd.claymore',
  212. 'xclkk' => 'application/vnd.crick.clicker.keyboard',
  213. 'xclkp' => 'application/vnd.crick.clicker.palette',
  214. 'xclkt' => 'application/vnd.crick.clicker.template',
  215. 'xclkw' => 'application/vnd.crick.clicker.wordbank',
  216. 'xclkx' => 'application/vnd.crick.clicker',
  217. 'xclp' => 'application/x-msclip',
  218. 'xcmc' => 'application/vnd.cosmocaller',
  219. 'xcmdf' => 'chemical/x-cmdf',
  220. 'xcml' => 'chemical/x-cml',
  221. 'xcmp' => 'application/vnd.yellowriver-custom-menu',
  222. 'xcmx' => 'image/x-cmx',
  223. 'xcom' => 'application/x-msdownload',
  224. 'xconf' => 'text/plain',
  225. 'xcpio' => 'application/x-cpio',
  226. 'xcpt' => 'application/mac-compactpro',
  227. 'xcrd' => 'application/x-mscardfile',
  228. 'xcrl' => 'application/pkix-crl',
  229. 'xcrt' => 'application/x-x509-ca-cert',
  230. 'xcsh' => 'application/x-csh',
  231. 'xcsml' => 'chemical/x-csml',
  232. 'xcss' => 'text/css',
  233. 'xcsv' => 'text/csv',
  234. 'xcurl' => 'application/vnd.curl',
  235. 'xcww' => 'application/prs.cww',
  236. 'xdaf' => 'application/vnd.mobius.daf',
  237. 'xdavmount' => 'application/davmount+xml',
  238. 'xdd2' => 'application/vnd.oma.dd2+xml',
  239. 'xddd' => 'application/vnd.fujixerox.ddd',
  240. 'xdef' => 'text/plain',
  241. 'xder' => 'application/x-x509-ca-cert',
  242. 'xdfac' => 'application/vnd.dreamfactory',
  243. 'xdis' => 'application/vnd.mobius.dis',
  244. 'xdjv' => 'image/vnd.djvu',
  245. 'xdjvu' => 'image/vnd.djvu',
  246. 'xdll' => 'application/x-msdownload',
  247. 'xdna' => 'application/vnd.dna',
  248. 'xdoc' => 'application/msword',
  249. 'xdot' => 'application/msword',
  250. 'xdp' => 'application/vnd.osgi.dp',
  251. 'xdpg' => 'application/vnd.dpgraph',
  252. 'xdsc' => 'text/prs.lines.tag',
  253. 'xdtd' => 'application/xml-dtd',
  254. 'xdvi' => 'application/x-dvi',
  255. 'xdwf' => 'model/vnd.dwf',
  256. 'xdwg' => 'image/vnd.dwg',
  257. 'xdxf' => 'image/vnd.dxf',
  258. 'xdxp' => 'application/vnd.spotfire.dxp',
  259. 'xecelp4800' => 'audio/vnd.nuera.ecelp4800',
  260. 'xecelp7470' => 'audio/vnd.nuera.ecelp7470',
  261. 'xecelp9600' => 'audio/vnd.nuera.ecelp9600',
  262. 'xecma' => 'application/ecmascript',
  263. 'xedm' => 'application/vnd.novadigm.edm',
  264. 'xedx' => 'application/vnd.novadigm.edx',
  265. 'xefif' => 'application/vnd.picsel',
  266. 'xei6' => 'application/vnd.pg.osasli',
  267. 'xeml' => 'message/rfc822',
  268. 'xeol' => 'audio/vnd.digital-winds',
  269. 'xeot' => 'application/vnd.ms-fontobject',
  270. 'xeps' => 'application/postscript',
  271. 'xesf' => 'application/vnd.epson.esf',
  272. 'xetx' => 'text/x-setext',
  273. 'xexe' => 'application/x-msdownload',
  274. 'xext' => 'application/vnd.novadigm.ext',
  275. 'xez' => 'application/andrew-inset',
  276. 'xez2' => 'application/vnd.ezpix-album',
  277. 'xez3' => 'application/vnd.ezpix-package',
  278. 'xfbs' => 'image/vnd.fastbidsheet',
  279. 'xfdf' => 'application/vnd.fdf',
  280. 'xfe_launch' => 'application/vnd.denovo.fcselayout-link',
  281. 'xfg5' => 'application/vnd.fujitsu.oasysgp',
  282. 'xfli' => 'video/x-fli',
  283. 'xflo' => 'application/vnd.micrografx.flo',
  284. 'xflw' => 'application/vnd.kde.kivio',
  285. 'xflx' => 'text/vnd.fmi.flexstor',
  286. 'xfly' => 'text/vnd.fly',
  287. 'xfnc' => 'application/vnd.frogans.fnc',
  288. 'xfpx' => 'image/vnd.fpx',
  289. 'xfsc' => 'application/vnd.fsc.weblaunch',
  290. 'xfst' => 'image/vnd.fst',
  291. 'xftc' => 'application/vnd.fluxtime.clip',
  292. 'xfti' => 'application/vnd.anser-web-funds-transfer-initiation',
  293. 'xfvt' => 'video/vnd.fvt',
  294. 'xfzs' => 'application/vnd.fuzzysheet',
  295. 'xg3' => 'image/g3fax',
  296. 'xgac' => 'application/vnd.groove-account',
  297. 'xgdl' => 'model/vnd.gdl',
  298. 'xghf' => 'application/vnd.groove-help',
  299. 'xgif' => 'image/gif',
  300. 'xgim' => 'application/vnd.groove-identity-message',
  301. 'xgph' => 'application/vnd.flographit',
  302. 'xgram' => 'application/srgs',
  303. 'xgrv' => 'application/vnd.groove-injector',
  304. 'xgrxml' => 'application/srgs+xml',
  305. 'xgtar' => 'application/x-gtar',
  306. 'xgtm' => 'application/vnd.groove-tool-message',
  307. 'xgtw' => 'model/vnd.gtw',
  308. 'xh261' => 'video/h261',
  309. 'xh263' => 'video/h263',
  310. 'xh264' => 'video/h264',
  311. 'xhbci' => 'application/vnd.hbci',
  312. 'xhdf' => 'application/x-hdf',
  313. 'xhlp' => 'application/winhlp',
  314. 'xhpgl' => 'application/vnd.hp-hpgl',
  315. 'xhpid' => 'application/vnd.hp-hpid',
  316. 'xhps' => 'application/vnd.hp-hps',
  317. 'xhqx' => 'application/mac-binhex40',
  318. 'xhtke' => 'application/vnd.kenameaapp',
  319. 'xhtm' => 'text/html',
  320. 'xhtml' => 'text/html',
  321. 'xhvd' => 'application/vnd.yamaha.hv-dic',
  322. 'xhvp' => 'application/vnd.yamaha.hv-voice',
  323. 'xhvs' => 'application/vnd.yamaha.hv-script',
  324. 'xice' => '#x-conference/x-cooltalk',
  325. 'xico' => 'image/x-icon',
  326. 'xics' => 'text/calendar',
  327. 'xief' => 'image/ief',
  328. 'xifb' => 'text/calendar',
  329. 'xifm' => 'application/vnd.shana.informed.formdata',
  330. 'xigl' => 'application/vnd.igloader',
  331. 'xigx' => 'application/vnd.micrografx.igx',
  332. 'xiif' => 'application/vnd.shana.informed.interchange',
  333. 'ximp' => 'application/vnd.accpac.simply.imp',
  334. 'xims' => 'application/vnd.ms-ims',
  335. 'xin' => 'text/plain',
  336. 'xipk' => 'application/vnd.shana.informed.package',
  337. 'xirm' => 'application/vnd.ibm.rights-management',
  338. 'xirp' => 'application/vnd.irepository.package+xml',
  339. 'xitp' => 'application/vnd.shana.informed.formtemplate',
  340. 'xivp' => 'application/vnd.immervision-ivp',
  341. 'xivu' => 'application/vnd.immervision-ivu',
  342. 'xjad' => 'text/vnd.sun.j2me.app-descriptor',
  343. 'xjam' => 'application/vnd.jam',
  344. 'xjava' => 'text/x-java-source',
  345. 'xjisp' => 'application/vnd.jisp',
  346. 'xjlt' => 'application/vnd.hp-jlyt',
  347. 'xjoda' => 'application/vnd.joost.joda-archive',
  348. 'xjpe' => 'image/jpeg',
  349. 'xjpeg' => 'image/jpeg',
  350. 'xjpg' => 'image/jpeg',
  351. 'xjpgm' => 'video/jpm',
  352. 'xjpgv' => 'video/jpeg',
  353. 'xjpm' => 'video/jpm',
  354. 'xjs' => 'application/javascript',
  355. 'xjson' => 'application/json',
  356. 'xkar' => 'audio/midi',
  357. 'xkarbon' => 'application/vnd.kde.karbon',
  358. 'xkfo' => 'application/vnd.kde.kformula',
  359. 'xkia' => 'application/vnd.kidspiration',
  360. 'xkml' => 'application/vnd.google-earth.kml+xml',
  361. 'xkmz' => 'application/vnd.google-earth.kmz',
  362. 'xkon' => 'application/vnd.kde.kontour',
  363. 'xksp' => 'application/vnd.kde.kspread',
  364. 'xlatex' => 'application/x-latex',
  365. 'xlbd' => 'application/vnd.llamagraphics.life-balance.desktop',
  366. 'xlbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
  367. 'xles' => 'application/vnd.hhe.lesson-player',
  368. 'xlist' => 'text/plain',
  369. 'xlog' => 'text/plain',
  370. 'xlrm' => 'application/vnd.ms-lrm',
  371. 'xltf' => 'application/vnd.frogans.ltf',
  372. 'xlvp' => 'audio/vnd.lucent.voice',
  373. 'xlwp' => 'application/vnd.lotus-wordpro',
  374. 'xm13' => 'application/x-msmediaview',
  375. 'xm14' => 'application/x-msmediaview',
  376. 'xm1v' => 'video/mpeg',
  377. 'xm2a' => 'audio/mpeg',
  378. 'xm3a' => 'audio/mpeg',
  379. 'xm3u' => 'audio/x-mpegurl',
  380. 'xm4u' => 'video/vnd.mpegurl',
  381. 'xmag' => 'application/vnd.ecowin.chart',
  382. 'xmathml' => 'application/mathml+xml',
  383. 'xmbk' => 'application/vnd.mobius.mbk',
  384. 'xmbox' => 'application/mbox',
  385. 'xmc1' => 'application/vnd.medcalcdata',
  386. 'xmcd' => 'application/vnd.mcd',
  387. 'xmdb' => 'application/x-msaccess',
  388. 'xmdi' => 'image/vnd.ms-modi',
  389. 'xmesh' => 'model/mesh',
  390. 'xmfm' => 'application/vnd.mfmp',
  391. 'xmgz' => 'application/vnd.proteus.magazine',
  392. 'xmid' => 'audio/midi',
  393. 'xmidi' => 'audio/midi',
  394. 'xmif' => 'application/vnd.mif',
  395. 'xmime' => 'message/rfc822',
  396. 'xmj2' => 'video/mj2',
  397. 'xmjp2' => 'video/mj2',
  398. 'xmlp' => 'application/vnd.dolby.mlp',
  399. 'xmmd' => 'application/vnd.chipnuts.karaoke-mmd',
  400. 'xmmf' => 'application/vnd.smaf',
  401. 'xmmr' => 'image/vnd.fujixerox.edmics-mmr',
  402. 'xmny' => 'application/x-msmoney',
  403. 'xmov' => 'video/quicktime',
  404. 'xmovie' => 'video/x-sgi-movie',
  405. 'xmp2' => 'audio/mpeg',
  406. 'xmp2a' => 'audio/mpeg',
  407. 'xmp3' => 'audio/mpeg',
  408. 'xmp4' => 'video/mp4',
  409. 'xmp4a' => 'audio/mp4',
  410. 'xmp4s' => 'application/mp4',
  411. 'xmp4v' => 'video/mp4',
  412. 'xmpc' => 'application/vnd.mophun.certificate',
  413. 'xmpe' => 'video/mpeg',
  414. 'xmpeg' => 'video/mpeg',
  415. 'xmpg' => 'video/mpeg',
  416. 'xmpg4' => 'video/mp4',
  417. 'xmpga' => 'audio/mpeg',
  418. 'xmpkg' => 'application/vnd.apple.installer+xml',
  419. 'xmpm' => 'application/vnd.blueice.multipass',
  420. 'xmpn' => 'application/vnd.mophun.application',
  421. 'xmpp' => 'application/vnd.ms-project',
  422. 'xmpt' => 'application/vnd.ms-project',
  423. 'xmpy' => 'application/vnd.ibm.minipay',
  424. 'xmqy' => 'application/vnd.mobius.mqy',
  425. 'xmrc' => 'application/marc',
  426. 'xmscml' => 'application/mediaservercontrol+xml',
  427. 'xmseq' => 'application/vnd.mseq',
  428. 'xmsf' => 'application/vnd.epson.msf',
  429. 'xmsh' => 'model/mesh',
  430. 'xmsi' => 'application/x-msdownload',
  431. 'xmsl' => 'application/vnd.mobius.msl',
  432. 'xmsty' => 'application/vnd.muvee.style',
  433. 'xmts' => 'model/vnd.mts',
  434. 'xmus' => 'application/vnd.musician',
  435. 'xmvb' => 'application/x-msmediaview',
  436. 'xmwf' => 'application/vnd.mfer',
  437. 'xmxf' => 'application/mxf',
  438. 'xmxl' => 'application/vnd.recordare.musicxml',
  439. 'xmxml' => 'application/xv+xml',
  440. 'xmxs' => 'application/vnd.triscape.mxs',
  441. 'xmxu' => 'video/vnd.mpegurl',
  442. 'xn-gage' => 'application/vnd.nokia.n-gage.symbian.install',
  443. 'xngdat' => 'application/vnd.nokia.n-gage.data',
  444. 'xnlu' => 'application/vnd.neurolanguage.nlu',
  445. 'xnml' => 'application/vnd.enliven',
  446. 'xnnd' => 'application/vnd.noblenet-directory',
  447. 'xnns' => 'application/vnd.noblenet-sealer',
  448. 'xnnw' => 'application/vnd.noblenet-web',
  449. 'xnpx' => 'image/vnd.net-fpx',
  450. 'xnsf' => 'application/vnd.lotus-notes',
  451. 'xoa2' => 'application/vnd.fujitsu.oasys2',
  452. 'xoa3' => 'application/vnd.fujitsu.oasys3',
  453. 'xoas' => 'application/vnd.fujitsu.oasys',
  454. 'xobd' => 'application/x-msbinder',
  455. 'xoda' => 'application/oda',
  456. 'xodc' => 'application/vnd.oasis.opendocument.chart',
  457. 'xodf' => 'application/vnd.oasis.opendocument.formula',
  458. 'xodg' => 'application/vnd.oasis.opendocument.graphics',
  459. 'xodi' => 'application/vnd.oasis.opendocument.image',
  460. 'xodp' => 'application/vnd.oasis.opendocument.presentation',
  461. 'xods' => 'application/vnd.oasis.opendocument.spreadsheet',
  462. 'xodt' => 'application/vnd.oasis.opendocument.text',
  463. 'xogg' => 'application/ogg',
  464. 'xoprc' => 'application/vnd.palm',
  465. 'xorg' => 'application/vnd.lotus-organizer',
  466. 'xotc' => 'application/vnd.oasis.opendocument.chart-template',
  467. 'xotf' => 'application/vnd.oasis.opendocument.formula-template',
  468. 'xotg' => 'application/vnd.oasis.opendocument.graphics-template',
  469. 'xoth' => 'application/vnd.oasis.opendocument.text-web',
  470. 'xoti' => 'application/vnd.oasis.opendocument.image-template',
  471. 'xotm' => 'application/vnd.oasis.opendocument.text-master',
  472. 'xots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
  473. 'xott' => 'application/vnd.oasis.opendocument.text-template',
  474. 'xoxt' => 'application/vnd.openofficeorg.extension',
  475. 'xp10' => 'application/pkcs10',
  476. 'xp7r' => 'application/x-pkcs7-certreqresp',
  477. 'xp7s' => 'application/pkcs7-signature',
  478. 'xpbd' => 'application/vnd.powerbuilder6',
  479. 'xpbm' => 'image/x-portable-bitmap',
  480. 'xpcl' => 'application/vnd.hp-pcl',
  481. 'xpclxl' => 'application/vnd.hp-pclxl',
  482. 'xpct' => 'image/x-pict',
  483. 'xpcx' => 'image/x-pcx',
  484. 'xpdb' => 'chemical/x-pdb',
  485. 'xpdf' => 'application/pdf',
  486. 'xpfr' => 'application/font-tdpfr',
  487. 'xpgm' => 'image/x-portable-graymap',
  488. 'xpgn' => 'application/x-chess-pgn',
  489. 'xpgp' => 'application/pgp-encrypted',
  490. 'xpic' => 'image/x-pict',
  491. 'xpki' => 'application/pkixcmp',
  492. 'xpkipath' => 'application/pkix-pkipath',
  493. 'xplb' => 'application/vnd.3gpp.pic-bw-large',
  494. 'xplc' => 'application/vnd.mobius.plc',
  495. 'xplf' => 'application/vnd.pocketlearn',
  496. 'xpls' => 'application/pls+xml',
  497. 'xpml' => 'application/vnd.ctc-posml',
  498. 'xpng' => 'image/png',
  499. 'xpnm' => 'image/x-portable-anymap',
  500. 'xportpkg' => 'application/vnd.macports.portpkg',
  501. 'xpot' => 'application/vnd.ms-powerpoint',
  502. 'xppd' => 'application/vnd.cups-ppd',
  503. 'xppm' => 'image/x-portable-pixmap',
  504. 'xpps' => 'application/vnd.ms-powerpoint',
  505. 'xppt' => 'application/vnd.ms-powerpoint',
  506. 'xpqa' => 'application/vnd.palm',
  507. 'xprc' => 'application/vnd.palm',
  508. 'xpre' => 'application/vnd.lotus-freelance',
  509. 'xprf' => 'application/pics-rules',
  510. 'xps' => 'application/postscript',
  511. 'xpsb' => 'application/vnd.3gpp.pic-bw-small',
  512. 'xpsd' => 'image/vnd.adobe.photoshop',
  513. 'xptid' => 'application/vnd.pvi.ptid1',
  514. 'xpub' => 'application/x-mspublisher',
  515. 'xpvb' => 'application/vnd.3gpp.pic-bw-var',
  516. 'xpwn' => 'application/vnd.3m.post-it-notes',
  517. 'xqam' => 'application/vnd.epson.quickanime',
  518. 'xqbo' => 'application/vnd.intu.qbo',
  519. 'xqfx' => 'application/vnd.intu.qfx',
  520. 'xqps' => 'application/vnd.publishare-delta-tree',
  521. 'xqt' => 'video/quicktime',
  522. 'xra' => 'audio/x-pn-realaudio',
  523. 'xram' => 'audio/x-pn-realaudio',
  524. 'xrar' => 'application/x-rar-compressed',
  525. 'xras' => 'image/x-cmu-raster',
  526. 'xrcprofile' => 'application/vnd.ipunplugged.rcprofile',
  527. 'xrdf' => 'application/rdf+xml',
  528. 'xrdz' => 'application/vnd.data-vision.rdz',
  529. 'xrep' => 'application/vnd.businessobjects',
  530. 'xrgb' => 'image/x-rgb',
  531. 'xrif' => 'application/reginfo+xml',
  532. 'xrl' => 'application/resource-lists+xml',
  533. 'xrlc' => 'image/vnd.fujixerox.edmics-rlc',
  534. 'xrm' => 'application/vnd.rn-realmedia',
  535. 'xrmi' => 'audio/midi',
  536. 'xrmp' => 'audio/x-pn-realaudio-plugin',
  537. 'xrms' => 'application/vnd.jcp.javame.midlet-rms',
  538. 'xrnc' => 'application/relax-ng-compact-syntax',
  539. 'xrpss' => 'application/vnd.nokia.radio-presets',
  540. 'xrpst' => 'application/vnd.nokia.radio-preset',
  541. 'xrq' => 'application/sparql-query',
  542. 'xrs' => 'application/rls-services+xml',
  543. 'xrsd' => 'application/rsd+xml',
  544. 'xrss' => 'application/rss+xml',
  545. 'xrtf' => 'application/rtf',
  546. 'xrtx' => 'text/richtext',
  547. 'xsaf' => 'application/vnd.yamaha.smaf-audio',
  548. 'xsbml' => 'application/sbml+xml',
  549. 'xsc' => 'application/vnd.ibm.secure-container',
  550. 'xscd' => 'application/x-msschedule',
  551. 'xscm' => 'application/vnd.lotus-screencam',
  552. 'xscq' => 'application/scvp-cv-request',
  553. 'xscs' => 'application/scvp-cv-response',
  554. 'xsdp' => 'application/sdp',
  555. 'xsee' => 'application/vnd.seemail',
  556. 'xsema' => 'application/vnd.sema',
  557. 'xsemd' => 'application/vnd.semd',
  558. 'xsemf' => 'application/vnd.semf',
  559. 'xsetpay' => 'application/set-payment-initiation',
  560. 'xsetreg' => 'application/set-registration-initiation',
  561. 'xsfs' => 'application/vnd.spotfire.sfs',
  562. 'xsgm' => 'text/sgml',
  563. 'xsgml' => 'text/sgml',
  564. 'xsh' => 'application/x-sh',
  565. 'xshar' => 'application/x-shar',
  566. 'xshf' => 'application/shf+xml',
  567. 'xsilo' => 'model/mesh',
  568. 'xsit' => 'application/x-stuffit',
  569. 'xsitx' => 'application/x-stuffitx',
  570. 'xslt' => 'application/vnd.epson.salt',
  571. 'xsnd' => 'audio/basic',
  572. 'xspf' => 'application/vnd.yamaha.smaf-phrase',
  573. 'xspl' => 'application/x-futuresplash',
  574. 'xspot' => 'text/vnd.in3d.spot',
  575. 'xspp' => 'application/scvp-vp-response',
  576. 'xspq' => 'application/scvp-vp-request',
  577. 'xsrc' => 'application/x-wais-source',
  578. 'xsrx' => 'application/sparql-results+xml',
  579. 'xssf' => 'application/vnd.epson.ssf',
  580. 'xssml' => 'application/ssml+xml',
  581. 'xstf' => 'application/vnd.wt.stf',
  582. 'xstk' => 'application/hyperstudio',
  583. 'xstr' => 'application/vnd.pg.format',
  584. 'xsus' => 'application/vnd.sus-calendar',
  585. 'xsusp' => 'application/vnd.sus-calendar',
  586. 'xsv4cpio' => 'application/x-sv4cpio',
  587. 'xsv4crc' => 'application/x-sv4crc',
  588. 'xsvd' => 'application/vnd.svd',
  589. 'xswf' => 'application/x-shockwave-flash',
  590. 'xtao' => 'application/vnd.tao.intent-module-archive',
  591. 'xtar' => 'application/x-tar',
  592. 'xtcap' => 'application/vnd.3gpp2.tcap',
  593. 'xtcl' => 'application/x-tcl',
  594. 'xtex' => 'application/x-tex',
  595. 'xtext' => 'text/plain',
  596. 'xtif' => 'image/tiff',
  597. 'xtiff' => 'image/tiff',
  598. 'xtmo' => 'application/vnd.tmobile-livetv',
  599. 'xtorrent' => 'application/x-bittorrent',
  600. 'xtpl' => 'application/vnd.groove-tool-template',
  601. 'xtpt' => 'application/vnd.trid.tpt',
  602. 'xtra' => 'application/vnd.trueapp',
  603. 'xtrm' => 'application/x-msterminal',
  604. 'xtsv' => 'text/tab-separated-values',
  605. 'xtxd' => 'application/vnd.genomatix.tuxedo',
  606. 'xtxf' => 'application/vnd.mobius.txf',
  607. 'xtxt' => 'text/plain',
  608. 'xumj' => 'application/vnd.umajin',
  609. 'xunityweb' => 'application/vnd.unity',
  610. 'xuoml' => 'application/vnd.uoml+xml',
  611. 'xuri' => 'text/uri-list',
  612. 'xuris' => 'text/uri-list',
  613. 'xurls' => 'text/uri-list',
  614. 'xustar' => 'application/x-ustar',
  615. 'xutz' => 'application/vnd.uiq.theme',
  616. 'xuu' => 'text/x-uuencode',
  617. 'xvcd' => 'application/x-cdlink',
  618. 'xvcf' => 'text/x-vcard',
  619. 'xvcg' => 'application/vnd.groove-vcard',
  620. 'xvcs' => 'text/x-vcalendar',
  621. 'xvcx' => 'application/vnd.vcx',
  622. 'xvis' => 'application/vnd.visionary',
  623. 'xviv' => 'video/vnd.vivo',
  624. 'xvrml' => 'model/vrml',
  625. 'xvsd' => 'application/vnd.visio',
  626. 'xvsf' => 'application/vnd.vsf',
  627. 'xvss' => 'application/vnd.visio',
  628. 'xvst' => 'application/vnd.visio',
  629. 'xvsw' => 'application/vnd.visio',
  630. 'xvtu' => 'model/vnd.vtu',
  631. 'xvxml' => 'application/voicexml+xml',
  632. 'xwav' => 'audio/x-wav',
  633. 'xwax' => 'audio/x-ms-wax',
  634. 'xwbmp' => 'image/vnd.wap.wbmp',
  635. 'xwbs' => 'application/vnd.criticaltools.wbs+xml',
  636. 'xwbxml' => 'application/vnd.wap.wbxml',
  637. 'xwcm' => 'application/vnd.ms-works',
  638. 'xwdb' => 'application/vnd.ms-works',
  639. 'xwks' => 'application/vnd.ms-works',
  640. 'xwm' => 'video/x-ms-wm',
  641. 'xwma' => 'audio/x-ms-wma',
  642. 'xwmd' => 'application/x-ms-wmd',
  643. 'xwmf' => 'application/x-msmetafile',
  644. 'xwml' => 'text/vnd.wap.wml',
  645. 'xwmlc' => 'application/vnd.wap.wmlc',
  646. 'xwmls' => 'text/vnd.wap.wmlscript',
  647. 'xwmlsc' => 'application/vnd.wap.wmlscriptc',
  648. 'xwmv' => 'video/x-ms-wmv',
  649. 'xwmx' => 'video/x-ms-wmx',
  650. 'xwmz' => 'application/x-ms-wmz',
  651. 'xwpd' => 'application/vnd.wordperfect',
  652. 'xwpl' => 'application/vnd.ms-wpl',
  653. 'xwps' => 'application/vnd.ms-works',
  654. 'xwqd' => 'application/vnd.wqd',
  655. 'xwri' => 'application/x-mswrite',
  656. 'xwrl' => 'model/vrml',
  657. 'xwsdl' => 'application/wsdl+xml',
  658. 'xwspolicy' => 'application/wspolicy+xml',
  659. 'xwtb' => 'application/vnd.webturbo',
  660. 'xwvx' => 'video/x-ms-wvx',
  661. 'xx3d' => 'application/vnd.hzn-3d-crossword',
  662. 'xxar' => 'application/vnd.xara',
  663. 'xxbd' => 'application/vnd.fujixerox.docuworks.binder',
  664. 'xxbm' => 'image/x-xbitmap',
  665. 'xxdm' => 'application/vnd.syncml.dm+xml',
  666. 'xxdp' => 'application/vnd.adobe.xdp+xml',
  667. 'xxdw' => 'application/vnd.fujixerox.docuworks',
  668. 'xxenc' => 'application/xenc+xml',
  669. 'xxfdf' => 'application/vnd.adobe.xfdf',
  670. 'xxfdl' => 'application/vnd.xfdl',
  671. 'xxht' => 'application/xhtml+xml',
  672. 'xxhtml' => 'application/xhtml+xml',
  673. 'xxhvml' => 'application/xv+xml',
  674. 'xxif' => 'image/vnd.xiff',
  675. 'xxla' => 'application/vnd.ms-excel',
  676. 'xxlc' => 'application/vnd.ms-excel',
  677. 'xxlm' => 'application/vnd.ms-excel',
  678. 'xxls' => 'application/vnd.ms-excel',
  679. 'xxlt' => 'application/vnd.ms-excel',
  680. 'xxlw' => 'application/vnd.ms-excel',
  681. 'xxml' => 'application/xml',
  682. 'xxo' => 'application/vnd.olpc-sugar',
  683. 'xxop' => 'application/xop+xml',
  684. 'xxpm' => 'image/x-xpixmap',
  685. 'xxpr' => 'application/vnd.is-xpr',
  686. 'xxps' => 'application/vnd.ms-xpsdocument',
  687. 'xxsl' => 'application/xml',
  688. 'xxslt' => 'application/xslt+xml',
  689. 'xxsm' => 'application/vnd.syncml+xml',
  690. 'xxspf' => 'application/xspf+xml',
  691. 'xxul' => 'application/vnd.mozilla.xul+xml',
  692. 'xxvm' => 'application/xv+xml',
  693. 'xxvml' => 'application/xv+xml',
  694. 'xxwd' => 'image/x-xwindowdump',
  695. 'xxyz' => 'chemical/x-xyz',
  696. 'xzaz' => 'application/vnd.zzazz.deck+xml',
  697. 'xzip' => 'application/zip',
  698. 'xzmm' => 'application/vnd.handheld-entertainment+xml',
  699. 'xodt' => 'application/x-vnd.oasis.opendocument.spreadsheet'
  700. );
  701. }