From a0f8e1323a0fb50e6a4b7449f93b493377eddd2c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 17 Apr 2006 13:09:50 +0000 Subject: - clean up marklist calls (global function) - added new feature: test out others permissions (admin permissions will not be copied) - changed attachment processing by directly using the template engine - fixed some attachment related bugs - additional tiny fixes git-svn-id: file:///svn/phpbb/trunk@5790 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_upload.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'phpBB/includes/functions_upload.php') diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index a9e08ec1e9..46449ff722 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -164,6 +164,39 @@ class filespec return array_pop($filename); } + /** + * Get mimetype + */ + function get_mimetype($filename) + { + if (function_exists('mime_content_type')) + { + $mimetype = mime_content_type($filename); + } + else + { + $mimetype = 'application/octetstream'; + } + + // Opera adds the name to the mime type + $mimetype = (strpos($mimetype, '; name') !== false) ? str_replace(strstr($mimetype, '; name'), '', $mimetype) : $mimetype; + + if (!$mimetype) + { + $mimetype = 'application/octetstream'; + } + + return $mimetype; + } + + /** + * Get filesize + */ + function get_filesize($filename) + { + return @filesize($filename); + } + /** * Move file to destination folder * -- cgit v1.2.1