I am trying to do a multiple file upload where in one input['file']
is for image and another one is for video
here is the controller
public function upload(){
$data['errorPic'] = $this->validateUpload();
$data['errorVid'] = $this->validateUpload2();
}
public function validateUpload(){
if ( $_FILES AND isset($_FILES['coverImage']['name']) ){
$config['upload_path'] = 'blogpics/';
$config['allowed_types'] = 'png|gif|jpg|jpeg';
$config['max_size'] = '999999';
$this->load->library("upload",$config);
if(!$this->upload->do_upload("coverImage")){
return $this->upload->display_errors();
}
}
}
public function validateUpload2(){
if ( $_FILES AND isset($_FILES['video']['name'])){
$config['upload_path'] = 'blogvids/';
$config['allowed_types'] = 'png|gif|jpg|jpeg';
$config['max_size'] = '999999';
$this->load->library("upload",$config);
if(!$this->upload->do_upload("video")){
return $this->upload->display_errors();
}
}
}
only the first function that is called is working
example:
if I put first the validateUpload2()
Function on the top of validateUpload()
function, the first function on the top is working the second one did not