Home > Backend Development > PHP Tutorial > Solve the problem that Codeigniter cannot upload rar and zip compressed packages_PHP tutorial

Solve the problem that Codeigniter cannot upload rar and zip compressed packages_PHP tutorial

WBOY
Release: 2016-07-13 10:37:15
Original
816 people have browsed it

The format restrictions of codeigniter when uploading files are defined in the mimes.php file in the config under the application folder. This file does not contain rar by default, and the definition of zip cannot be used to upload compressed packages. We can solve this problem by adding the following code to the class:

Copy the code The code is as follows:
"zip" => array("application/x-zip", "application/zip" , "application/x-zip-compressed", "application/octet-stream"),//It turns out there are only the first three items
"rar" => ; array("application/octet-stream"),//It turns out that there is no rar item at all, the whole thing was added by myself

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/736786.htmlTechArticlecodeigniter’s format restrictions when uploading files are defined in the mimes.php file in the config under the application folder of. This file does not contain rar by default, and the definition of zip cannot be uploaded...
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