我正在尝试在 CI 注册过程中上传个人资料图片 ($me !== 'experienced' )
这是我的方法......没什么奇怪的
function do_upload()
{
$config['upload_path'] = base_url('/upload_pic/');
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload() )
{
$data['message'] = $this->upload->display_errors() . $config['upload_path'];
$this->load->view('profile_photo_view', $data);
}
else
{
$data['message'] = $this->upload->data();
$this->load->view('upload_success', $data);
}
}
..但它失败了。如您所见,我将上传路径传递给我的失败页面以进行显示,这就是它所显示的内容..
The upload path does not appear to be valid.
http://localhost:8888/MY_SITE/upload_pic
那是我的上传文件夹所在的位置。我拥有完整的 777 权限..
..任何想法可能是错的?尾随斜线是否总是会被这样剥离?