CodeIgniter 无法上传 CSV 文件

本篇文章由:http://xinpure.com/codeigniter-unable-to-upload-a-csv-file/

解决 CodeIgniter 中使用 Upload 类无法上传 CSV 的问题。

将:

'csv'   =>  array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel')

替换为:

'csv'   =>  array('application/vnd.ms-excel', 'text/anytext', 'text/plain', 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel')

即,添加 'application/vnd.ms-excel', 'text/anytext', 'text/plain' 三种类型

posted @ 2015-05-29 14:55  xinpureZhu  阅读(280)  评论(0编辑  收藏  举报