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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -