Welcome Guest, Not a member yet? Register   Sign In
Upload library not recognizing allowed file type
#1

[eluser]GeXus[/eluser]
I'm using the upload library to upload some video, I have the following set:

Code:
$config['allowed_types'] = 'mov|wmv|mpeg|mpg|avi|mpeg4';

I just attempted to upload a valid .wmv file, but received the error "The filetype you are attempting to upload is not allowed."

Any ideas?

Thanks!
#2

[eluser]Ruh[/eluser]
Same here?!
#3

[eluser]mi6crazyheart[/eluser]
Can u show u'r controller code plz...
#4

[eluser]danmontgomery[/eluser]
You need to add wmv to config/mimes.php:

Code:
'wmv' => 'video/x-ms-wmv',

(the mime type used is dependent on browser, so you may need to use a different value)
#5

[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] => )
#6

[eluser]danmontgomery[/eluser]
Quote:[file_type] => video/mp4


Code:
'avi'    =>    array('video/x-msvideo','video/mp4'),
#7

[eluser]Ruh[/eluser]
opss i made a mistake in code which is i posted here..

i wrote like that in mimes.php

Code:
'mp4'    =>    array('video/mp4'),
'avi'    =>    array('video/x-msvideo','video/avi'),
'mpeg'    =>    'video/mpeg',
'mpg'    =>    'video/mpeg',
'flv'    =>     'video/x-flv',

but it's still not working :/

i'll try to install fresh copy.
#8

[eluser]danmontgomery[/eluser]
What you have is not what I posted...
#9

[eluser]InsiteFX[/eluser]
Check to make sure the mime types are on your server also...

Sometimes you have to go into CPanel and turn them on.
This happened to on my server for flv. It was not on.

InsiteFX
#10

[eluser]mi6crazyheart[/eluser]
Also check u'r upload folder is writable(file permissions to 777) or not...




Theme © iAndrew 2016 - Forum software by © MyBB