【发布时间】:2016-03-22 13:02:58
【问题描述】:
我正在使用从这个站点上传 php 类:http://www.verot.net/
图片上传工作正常。但是当我尝试上传 csv 文件时出现错误:
getimagesize(): Read error! [APP\Vendor\class.upload.php, line 2423]
这是我的代码:
$upload = new Upload($file['file']);
$upload->no_script = false;
$upload->allowed = array('application/msword');
$upload->file_new_name_body = 'data';
$upload->process($this->target_path);
if (!$upload->processed) {
$msg = $this->generateError($upload->error);
$this->Session->setFlash($msg);
return $this->redirect($this->referer());
}
这里 $file 有附件的所有信息。 如果我尝试上传图像,它可以正常工作,但是当我尝试上传 csv 文件时,它会显示错误。我设置了 mime 类型。但没有运气。任何人都有这种经历。或者有没有像verot.net这样的插件来上传文件。任何想法将不胜感激
【问题讨论】:
-
确保
$this->target_path中定义的路径是Apache可读/可写的。
标签: php csv file-upload