Error when use do_upload
I have a problem when i use do_upload its always error with The upload
path does not appear to be valid.
function save_blog(){
$config['upload_path'] =
'ftp://username:password@hostname:port/public_html/img/blog/';
//$config['upload_path'] = 'img/blog/';
$config['allowed_types'] = 'gif|jpg|png';
get_instance()->load->library('upload', $this->config);
echo $config['upload_path'];
if($this->upload->do_upload('myDoc'))
{
echo "file upload success";
}
else
{
echo $this->upload->display_errors();
}
}
On my server there are path /public_html/img/blog/
PS* i can use do_upload when i used a simple code like
http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html
but on my project I have to upload 2 files in one click so I try to use
$this->upload->do_upload('myDoc') for one of my input first but it still
error.
No comments:
Post a Comment