SWFUpload and CI cannot correctly upload the MIME type of the recognized file to share the solution_PHP tutorial

WBOY
Release: 2016-07-21 15:30:49
Original
730 people have browsed it

The solution is as follows, other frameworks are the same.

Source code (/system/libraries/upload.php 199 line)

$this->file_type = preg_replace("/^(.+?);.*$/", "\1", $_FILES[$field]['type']);

is modified as follows:

Copy code The code is as follows:

//Edit By Tacker
if(function_exists('mime_content_type')){
$this->file_type = preg_replace("/^(.+? );.*$/", "\1", mime_content_type($this->file_temp));
}else{
$this->file_type = preg_replace("/^(.+?) ;.*$/", "\1", $_FILES[$field]['type']);
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323126.htmlTechArticleThe solution is as follows, other frameworks are the same. Source code (/system/libraries/upload.php 199 line) $this-file_type = preg_replace("/^(.+?);.*$/", "\1", $_FILES[$field]['type ']); modified to...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!