upload multiple documents with PHP Codeigniter -
i working on user registration form in user required upload profile image , document verification purposes. these 2 different fields in form. code works fine problem uploads profile image , stores in verification documents folder. not upload verification document. works fine if remove or comment 1 of field.
below controller function.
/** upload profile image **/ $prof_pic = $_files['profile_pic']['name']; $config = array ('upload_path' => './images/tutors/', 'allowed_types' => "jpeg|jpg|png", 'overwrite' => true ); $this->load->library('upload', $config); $this->upload->do_upload('profile_pic'); /** upload verification document **/ $tut_ver_docs = $_files['tut_ver_docs']['name']; $new_config = array ('upload_path' => './emp_verification_documents/', 'allowed_types' => "jpeg|jpg|png", 'overwrite' => true ); $this->load->library('upload', $new_config); $this->upload->do_upload('tut_ver_docs');
try replacing:
$this->load->library('upload', $config);
with :
$this->load->library('upload'); $this->upload->initialize($config);
Comments
Post a Comment