From 0e84319ea74a23beabc9949d4a3e7853aaa7ab59 Mon Sep 17 00:00:00 2001 From: ve3 Date: Mon, 18 Oct 2021 07:37:03 +0700 Subject: [PATCH] Add file extensions and mime types. --- Rundiz/Upload/file-extensions-mime-types.php | 9 +++++++-- tests/via-http/test-get-upload-file-mimetype.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Rundiz/Upload/file-extensions-mime-types.php b/Rundiz/Upload/file-extensions-mime-types.php index 2d3252f..6df0aca 100644 --- a/Rundiz/Upload/file-extensions-mime-types.php +++ b/Rundiz/Upload/file-extensions-mime-types.php @@ -17,12 +17,13 @@ '3gp' => array('audio/3gpp', 'video/3gpp'), '7z' => array('application/x-7z-compressed'), 'aac' => array('audio/aac', 'audio/aacp', 'audio/x-aac', 'audio/x-hx-aac-adts'), - 'avi' => array('video/x-msvideo'), + 'avi' => array('video/avi', 'video/msvideo', 'video/x-msvideo'), 'bmp' => array('image/bmp', 'image/x-windows-bmp'), 'bz' => array('application/x-bzip'), 'bz2' => array('application/x-bzip2'), 'css' => array('text/css'), 'csv' => array('application/csv', 'application/excel', 'application/vnd.ms-excel', 'application/vnd.msexcel', 'application/x-csv', 'text/comma-separated-values', 'text/csv', 'text/x-comma-separated-values', 'text/x-csv'), + 'db' => array('application/vnd.sqlite3', 'application/x-sqlite3'),// sqlite 'doc' => array('application/msword'), 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document'), 'dvi' => array('application/x-dvi'), @@ -49,10 +50,12 @@ 'lzh' => array('application/x-lzh'), 'm3u' => array('audio/x-mpegurl'), 'm4a' => array('audio/mp4', 'audio/x-m4a'), + 'm4v' => array('video/x-m4v'), 'mdb' => array('application/x-msaccess'), 'mid' => array('application/midi', 'application/x-midi', 'audio/midi', 'audio/x-mid', 'audio/x-midi', 'music/crescendo', 'x-music/x-midi'), 'midi' => array('application/midi', 'application/x-midi', 'audio/midi', 'audio/x-mid', 'audio/x-midi', 'music/crescendo', 'x-music/x-midi'), 'mjs' => array('text/javascript'), + 'mkv' => array('video/x-matroska'), 'mov' => array('video/quicktime'), 'mpa' => array('audio/mpeg', 'video/mpeg'), 'mp3' => array('audio/mp3', 'audio/mpeg', 'audio/mpeg3', 'audio/mpg', 'audio/x-mpeg-3'), @@ -79,6 +82,8 @@ 'rtf' => array('application/rtf', 'application/x-rtf', 'text/richtext'), 'rss' => array('application/rss+xml'), 'shtml' => array('text/html', 'text/x-server-parsed-html'), + 'sql' => array('application/sql', 'text/plain'), + 'sqlite' => array('application/vnd.sqlite3', 'application/x-sqlite3'),// sqlite 'sub' => array('image/vnd.dvb.subtitle'), 'svg' => array('image/svg+xml'), 'swf' => array('application/x-shockwave-flash'), @@ -103,7 +108,7 @@ 'xhtml' => array('application/xhtml+xml'), 'xls' => array('application/excel', 'application/msexcel', 'application/vnd.ms-excel'), 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'), - 'xml' => array('application/rss+xml', 'text/xml'), + 'xml' => array('application/atom+xml', 'application/rss+xml', 'application/xml', 'text/xml'), 'xsl' => array('text/xml'), 'yaml' => array('text/yaml'), 'yml' => array('text/yaml'), diff --git a/tests/via-http/test-get-upload-file-mimetype.php b/tests/via-http/test-get-upload-file-mimetype.php index 665723e..97f44ba 100644 --- a/tests/via-http/test-get-upload-file-mimetype.php +++ b/tests/via-http/test-get-upload-file-mimetype.php @@ -18,7 +18,7 @@
-

Test get uploaded file's mime type.

+

Test get uploaded file's mime type using Finfo.