diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2007-02-09 14:24:34 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-02-09 14:24:34 +0000 |
| commit | 7216ffe8be85a58eedb4f1e7fe2278a89110be9d (patch) | |
| tree | 0991b1d26b268f0a97a54cdea6edad9c0708daab /phpBB/includes/functions_upload.php | |
| parent | 56a93bdfdddde618fe826c23c9151086f9540860 (diff) | |
| download | forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.tar forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.tar.gz forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.tar.bz2 forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.tar.xz forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.zip | |
some fixes to be committed.
git-svn-id: file:///svn/phpbb/trunk@6975 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_upload.php')
| -rw-r--r-- | phpBB/includes/functions_upload.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 3f40a35bb2..1dd40f3f1c 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -561,7 +561,20 @@ class fileupload { $_FILES[$form_name]['name'] = basename($source_file); $_FILES[$form_name]['size'] = 0; - $_FILES[$form_name]['type'] = ''; + $mimetype = ''; + + if (function_exists('mime_content_type')) + { + $mimetype = mime_content_type($filename); + } + + // Some browsers choke on a mimetype of application/octet-stream + if (!$mimetype || $mimetype == 'application/octet-stream') + { + $mimetype = 'application/octetstream'; + } + + $_FILES[$form_name]['type'] = $mimetype; } else { |
