this is my controller function and below is my view file code pleas help to find out the error in my code
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Upload extends CI_Controller {
function __construct(){
parent::__construct();
}
function test(){
if($this->input->post('submit')){
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'].'/assets/uploads/';
$config['allowed_types'] = 'mp4';
$this->load->library('upload',$config);
if ( ! $this->upload->do_upload()){
$error = array('error' => $this->upload->display_errors());
}else{
$data = array('upload_data' => $this->upload->data());
}
}
$this->load->view('upload/test');
}
}
?>
and this is my view code->
<form action="" method="POST" enctype="multipart/form-data" >
Select File To Upload:<br />
<input type="file" name="userfile" />
<br /><br />
<input type="submit" name="submit" value="Upload" class="btn btn-success" />
</form>
and i m getting errors are ->