From 7216ffe8be85a58eedb4f1e7fe2278a89110be9d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 9 Feb 2007 14:24:34 +0000 Subject: some fixes to be committed. git-svn-id: file:///svn/phpbb/trunk@6975 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_upload.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_upload.php') 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 { -- cgit v1.2.1