上传zip和rar文件不工作在codeigniter [英] Uploading zip and rar file not working in codeigniter

查看:158
本文介绍了上传zip和rar文件不工作在codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置已为允许的类型创建:

setting i have created for allowed type:

  $config['allowed_types'] = 'doc|docx|pdf|xls|xlsx|rtf|txt|rar|zip';

和我的mine.php

and in my mine.php

  'zip' =>  array('application/x-zip', 'application/zip', 'application/x-zip-compressed','application/force-download'),
  'rar' =>  array('application/x-rar', 'application/rar','application/x-rar-compressed','application/force-download'),

这是所有我已配置,但当我做zip或rar上传它显示我的错误,您尝试上传的文件类型是不允许的。

this is all i have configured but when i do the zip or rar upload its shows me error that "The filetype you are attempting to upload is not allowed."

请帮助任何一个...预先感谢。

PLEASE HELP ANY ONE .. THANKS IN ADVANCE..

推荐答案

zip和rar的mime.php配置为:

i replace the mime.php configuration for zip and rar to:

 'zip'  =>  array('application/x-zip', 'application/zip', 'application/x-zip-compressed','application/force-download','application/octet-stream'),
 'rar'  =>  array('application/x-rar', 'application/rar','application/x-rar-compressed','application/force-download','application/octet-stream'),

我刚刚添加了应用程序/ octet流在结束..对于类型,现在我能够上传两个zip和rar ... :)现在我很开心

i have just added the application/octet-stream at the end.. for both the type and now i am able to upload both zip and rar... :) now i am happy

这篇关于上传zip和rar文件不工作在codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆