Codeigniter psd和ai mime类型不起作用

时间:2016-02-03 13:53:06

标签: php codeigniter file-upload mime-types mime

我已经访问了一些相关问题并尝试了该步骤,但在使用codeigniter上传文件时仍然出错 尝试上传psd或ai文件时The filetype you are attempting to upload is not allowed 我为允许的文件类型

尝试了类似的东西
$config['allowed_types'] = 'psd|ai|gif|jpg|png|xlsx|xls|pdf|doc|docx';

我看了config/mimes.php psd的值是

'psd'   =>  'application/x-photoshop',

我的浏览器发送文件类型'application/octet-stream' 我改变了mimes.php

'psd'   =>  array('application/x-photoshop','application/octet-stream'),

但仍然是同样的错误
The filetype you are attempting to upload is not allowed

请帮帮我

2 个答案:

答案 0 :(得分:4)

尝试使用psd文件

'psd'   =>  array('application/x-photoshop','application/octet-stream','image/vnd.adobe.photoshop'),

答案 1 :(得分:1)

扩展的psd扩展程序

更改此内容(application/config/mimes.php

'psd'    =>    'application/x-photoshop',

到此
方法01(上传psd文件)

'psd'    =>    array('image/photoshop', 'image/x-photoshop', 'image/psd', 'application/photoshop', 'application/psd', 'zz-application/zz-winassoc-psd'),

或者
方法02(上传cdr和psd文件)

'psd'    =>    array('application/x-photoshop','application/octet-stream'),
'cdr'   =>      array('application/octet-stream','application/x-zip-compressed','image/x-coreldraw'),