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
http://www.bkjia.com/PHPjc/736786.htmlwww.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...
Statement: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