Heim  >  Artikel  >  Backend-Entwicklung  >  解决Codeigniter不能上传rar和zip压缩包问题_PHP教程

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

WBOY
WBOYOriginal
2016-07-13 10:37:15768Durchsuche

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这一项,整个都是自己加上去的

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/736786.htmlTechArticlecodeigniter在上传文件时对格式的限制是在application文件夹下config中的mimes.php文件中定义的。该文件默认不包含rar,而且对zip的定义不能上传压...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn