|
@@ -301,13 +301,22 @@ class Core
|
|
|
if (!function_exists('finfo_open')) {
|
|
|
return $this->getExtByByte($filename);
|
|
|
}
|
|
|
+
|
|
|
+ if (isset($this->data['file']['type'])) {
|
|
|
+ $ext = $this->getExtByMine($this->data['file']['type']);
|
|
|
+ }
|
|
|
$finfo = finfo_open(FILEINFO_MIME); // 返回 mime 类型
|
|
|
$code = finfo_file($finfo, $filename);
|
|
|
finfo_close($finfo);
|
|
|
$temp = explode(';', $code);
|
|
|
$ext = $this->getExtByMine($temp[0]);
|
|
|
- if (!$ext || $ext == 'txt') {
|
|
|
- $ext = $this->getExtByByte($filename);
|
|
|
+ if (!$ext || $ext == 'txt' || $ext == 'exe') {
|
|
|
+ if (isset($this->data['file']['type'])) {
|
|
|
+ $ext = $this->getExtByMine($this->data['file']['type']);
|
|
|
+ }
|
|
|
+ if (!$ext || $ext == 'txt' || $ext == 'exe') {
|
|
|
+ $ext = $this->getExtByByte($filename);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return $ext;
|
|
@@ -333,6 +342,7 @@ class Core
|
|
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx',
|
|
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx',
|
|
|
'video/x-m4v' => 'mp4',
|
|
|
+ 'video/mp4' => 'mp4',
|
|
|
'application/octet-stream' => 'exe',
|
|
|
'application/oda' => 'oda',
|
|
|
'application/olescript' => 'axs',
|
|
@@ -417,6 +427,7 @@ class Core
|
|
|
'audio/mid' => 'mid',
|
|
|
'audio/mid' => 'rmi',
|
|
|
'audio/mpeg' => 'mp3',
|
|
|
+ 'audio/mp3' => 'mp3',
|
|
|
'audio/x-aiff' => 'aif',
|
|
|
'audio/x-aiff' => 'aifc',
|
|
|
'audio/x-aiff' => 'aiff',
|