[eluser]ebot[/eluser]
i will be grateful for any help on this codes of mine. Every time i try uploading a flv video file i get this error message: the file type is not allowed, but i did add the flv format on the allow_type config stuff, here are the codes
everything has been specified, so i don't know why i'd get the errors
Code:
function uploadVideo()
{
$config['upload_path'] = './videos/';
$config['allowed_types'] = 'flv';
$config['max_size'] = '50940';
//form set up
$rules['name'] = "required";
$fields['name'] = 'name';
$this->validation->set_rules($rules);
$this->validation->set_fields($fields);
// check whether form has been run and validates
if ($this->validation->run() == FALSE)
{
$this->session->set_flashdata('notice','Your video was not been uploaded!');
redirect('manage/addVideo');
}
//else yes so do upload
else
{
$this->load->library('upload', $config);
//if upload not success display errors
if ( ! $this->upload->do_upload())
{
$data['error'] = $this->upload->display_errors();
$this->load->view('admin/addvideo', $data);
}
//else do form insert, image upload and image resize!!
else
{
//upload data
$data['upload_data'] = $this->upload->data();
$image=$data['upload_data']['orig_name'];
$this->videoM->newVideo($image, $_POST);
$this->session->set_flashdata('message','Your video has been uploaded');
redirect('manage/video');
}
}
}