[英]Uploading files in codeigniter
尝试将上载的文件移动到最终目的地时遇到问题
无法使用他们的上载类在codeigniter中上载文件 ,上载目录也存在,下面是一个代码
$config = array(
'upload_path' => './upload_dir/users_docs/',
'allowed_types' => 'gif|png|jpeg',
'max_size' => 0,
'max_width' => 0,
'max_height' => 0,
'file_name' => $this->currTime,
);
$this->load->library('upload', $config);
if (!empty($_FILES['company_logo']['name']) && !$this->upload->do_upload('company_logo')) {
$error = array('error' => $this->upload->display_errors());
$this->session->set_flashdata('error_message', $error['error']);
redirect('home');
}
$data = array('upload_data' => $this->upload->data());
'file_name'=> $ this-> currTime中存在一个问题,时间格式不正确, Apostrophe在文件名var中出现 ,我只是将其更改为其他名称,现在可以使用了,谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.