我正在使用CodeIgniter文件上传类上传图像。但如果我尝试选择PDF而不是图像,我在提交表单时没有得到任何错误。
相关代码
$config = array(
'allowed_types' => 'jpg|jpeg|gif|png',
'upload_path' => $this->article_path.'/magazine',
'max_size' => 2000
);
$this->load->library('upload', $config);
$this->upload->do_upload();
$this->upload->display_errors();
$image_data = $this->upload->data();
1条答案
按热度按时间r55awzrz1#
这是因为你从来没有去看过文档(here),请这样做以便在CodeIgniter框架中更好地执行。
这应该给你提个醒(请阅读评论)