How to upload and save recorded video using webrtc in codeigniter

This is my controller code for uploading video

function saveRecord()
		{
		$fileName='';
		$tmp = $this->input->post('fileInfo');
		$jobseeker_id= $GLOBALS['jobseeker_id'] ;

        if(((isset($_POST)) && (!empty($_POST)) && (isset($_FILES))))
	{
	$tmpArr = explode(":",$tmp);

			if(isset($tmpArr[0])){
                $fileName = $tmpArr[0];
			}

            foreach(array('video', 'audio') as $type){
                if (isset($_FILES["${type}-blob"])) 
		{
		$fileName = $_POST["${type}-filename"];
                $uploadDirectory = '/assets/img/videos/assets/'.$fileName;
		if (!move_uploaded_file($_FILES["${type}-blob"]["tmp_name"], $uploadDirectory))
		 {
                       
                        log_message('error', __CLASS__ . ' , '.__FUNCTION__.' problem uploading file..');
                    }
                    echo($fileName);
                }
            }

			if(!empty($fileName)){
				$data=array('jobseeker_id'=>$jobseeker_id,
					'uploaded_video'=>$fileName
				);
				$this->Jobseeker_model->saveRecord($data);
			}
		}

	}

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.