[eluser]Ruh[/eluser]
i tried for avi like that.
Code:
'avi' => array('video/x-msvideo','video/avi'),
but it didn't work.
i also tried in .htaccess
Code:
AddType video/x-flv .flv
AddType video/mp4 .mp4
AddType video/avi .avi
but it didn't work. Here is the full code:
Code:
function VideoUpload(){
$file = 'video_file';
$config['upload_path'] = 'Upload/';
$config['allowed_types'] = 'mov|mpeg|mp3|mp4|avi';
$config['max_size'] = '50000';
$config['max_width'] = '';
$config['max_height'] = '';
$this->load->library('upload', $config);
if(!$this->upload->do_upload($file))
{
echo $this->upload->display_errors();
}
else
{
$data=array('upload_data' => $this->upload->data());
$video_path = $data['upload_data']['file_name'];
$directory_path = $data['upload_data']['file_path'];
$directory_path_full = $data['upload_data']['full_path'];
$file_name = $data['upload_data']['raw_name'];
exec("ffmpeg -i ".$directory_path_full." ".$directory_path.$file_name.".flv");
redirect('/VideoPlayer/'.$file_name);
}
}
And here is the error message:
Code:
Error in Uploading video
The filetype you are attempting to upload is not allowed.
And the upload data:
Code:
Array ( [file_name] => 156218057739800_10031.mp4 [file_type] => video/mp4 [file_path] => /home/****/domains/******/public_html/Upload/ [full_path] => /home/******/domains/******/public_html/Upload/156218057739800_10031.mp4 [raw_name] => 156218057739800_10031 [orig_name] => [client_name] => 156218057739800_10031.mp4 [file_ext] => .mp4 [file_size] => 6448977 [is_image] => [image_width] => [image_height] => [image_type] => [image_size_str] => )