无法在Codeigniter中导入xlsx文件 [英] Unable to import xlsx file in Codeigniter

查看:197
本文介绍了无法在Codeigniter中导入xlsx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在所有的配置后,如果我试图导入csv或xls文件我很容易能够这样做,但那一刻,我试图导入xlsx文件gettig一个错误'您正尝试上传的文件类型是不允许的'。在文件mimes.php

 'xlsx'=> array('application / vnd.openxmlformats-officedocument.spreadsheetml.sheet','application / zip'),

get error as'您尝试上传的文件类型不允许。任何建议都会赞赏thnx。

解决方案

请尝试以下



p>

$ config ['allowed_types'] ='*'; //所有文件



如果它是工作,请检查$ _FILES您的浏览器读取.xlsx文件的mime类型



您还可以检查与另一个excel导入(如果所有以上解决方案不工作)
http: //phpexcel.codeplex.com/


after all the configuration if I am trying to import csv or xls file I am easily being able to do that but, the moment I am trying to import xlsx file gettig an error 'The filetype you are attempting to upload is not allowed'. In the file mimes.php

'xlsx'  =>  array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'),

getting error as 'The filetype you are attempting to upload is not allowed'. Any suggestion will be appreciated thnx.

解决方案

Please try with following

On upload function use

$config['allowed_types'] = '*'; //All Files

If it is working then Please check with $_FILES for what mime type your browser read for .xlsx file

Your can also check with another excel import (If all above solution is not working) http://phpexcel.codeplex.com/

这篇关于无法在Codeigniter中导入xlsx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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