解决Codeigniter不能上传rar和zip压缩包问题_PHP

WBOY
Release: 2016-06-01 11:55:21
Original
938 people have browsed it

CI框架

codeigniter在上传文件时对格式的限制是在application文件夹下config中的mimes.php文件中定义的。该文件默认不包含rar,而且对zip的定义不能上传压缩包。我们在类中,加入以下代码,即可解决这个问题:
复制代码 代码如下:"zip" => array("application/x-zip", "application/zip" ,"application/x-zip-compressed","application/octet-stream"),//原来只有前三项
"rar" => array("application/octet-stream"),//原来根本就没有rar这一项,整个都是自己加上去的

Related labels:
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!