Changeset 514 for trunk/Modules/File
- Timestamp:
- Apr 8, 2013, 10:40:40 PM (12 years ago)
- Location:
- trunk/Modules/File
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/File/File.php
r507 r514 1 1 <?php 2 3 include_once(dirname(__FILE__).'/MimeTypes.php'); 2 4 3 5 class File extends Module … … 41 43 function DetectMimeType($FileName) 42 44 { 43 // For proper mime-type detection php-pecl-Fileinfo package should be installed on *nix systems 44 $FileInfo = new finfo(FILEINFO_MIME, '/usr/share/misc/magic'); 45 $Result = $FileInfo->file($FileName); 46 //$FileInfo->close(); 45 global $MimeTypes; 46 47 $Result = $MimeTypes[pathinfo($FileName, PATHINFO_EXTENSION)][0]; 47 48 return($Result); 48 49 }
Note:
See TracChangeset
for help on using the changeset viewer.