Skip to content

Commit

Permalink
Add file extensions and mime types.
Browse files Browse the repository at this point in the history
  • Loading branch information
ve3 committed Oct 18, 2021
1 parent a025655 commit 0e84319
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Rundiz/Upload/file-extensions-mime-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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'),
Expand All @@ -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'),
Expand All @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion tests/via-http/test-get-upload-file-mimetype.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="container">
<div class="row">
<div class="col-xs-12">
<h1>Test get uploaded file's mime type.</h1>
<h1>Test get uploaded file's mime type using <a href="https://www.php.net/manual/en/class.finfo.php" target="finfo">Finfo</a>.</h1>
<?php if (isset($file_info) && !empty($file_info)) { ?>
<div class="alert alert-warning">
<?php echo $file_info; ?>
Expand Down

0 comments on commit 0e84319

Please sign in to comment.