【发布时间】:2016-11-15 14:33:10
【问题描述】:
我在 IIS 上配置了一个代码点火器项目。使用上传库在用户模型中上传图像时遇到问题。这是我的功能。
public function upload_image($file,$path, $url) {
$image = time();
//////////Remove any Old file with this name///////
if (file_exists($path . $image))
unlink($path . $image);
///////////////////////////////////////////////////
$config['upload_path'] = $path;
$config['allowed_types'] = 'jpg|png|gif|jpeg';
$config['file_name'] = $image;
$this->load->library('upload', $config);
$this->upload->initialize($config);
if (!$this->upload->do_upload($file)) {
$this->session->set_flashdata('error', $this->upload->display_errors());
return false;//redirect($url);
// $this->session->set_flashdata('post', $this->input->post());
// $this->reload($url, $this->upload->display_errors(), 'danger');
} else {
$upload_data = $this->upload->data();
return $upload_data['file_name'];
}
}
我是这样从控制器调用这个函数的
$path = 'assets/profileimages/';
$file = 'imagefile';
$imagepath= $this->users->upload_image($file,$path,'Users/addUser');
出现以下错误。
domainname currently unable to handle this request.
在日志中,我有以下错误。
404 Page Not Found: Users/assets
谁能帮我解决这个问题?
【问题讨论】:
标签: php codeigniter