Просмотр файла sys/fnc/ras_to_mime.php

Размер файла: 452B
  1. <?
  2. function ras_to_mime($ras=null)
  3. {
  4. if ($ras==null)
  5. {
  6. return 'application/octet-stream';
  7. }
  8. else
  9. {
  10. $htaccess=file(H.'.htaccess');
  11. for ($i=0;$i<count($htaccess);$i++)
  12. {
  13. if (eregi('^AddType',trim($htaccess[$i])))
  14. {
  15. $type=explode(' ', trim($htaccess[$i]));
  16. $rass=str_replace('.',null,$type[2]);
  17. $mime[$rass]=$type[1];
  18. }
  19. }
  20.  
  21. if (isset($mime[$ras]))
  22. {
  23. return $mime[$ras];
  24. }
  25. else
  26. return 'application/octet-stream';
  27. }
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34. ?>