Welcome Guest, Not a member yet? Register   Sign In
.ogv file upload not allowed (CI 2.1.3)
#1

[eluser]Unknown[/eluser]
Hi,

I'm hoping i've just overlooked something simple here but can't see a solution.

I have a form uploading multiple files - all upload fine except the .ogv file. Instead it returns
The filetype you are attempting to upload is not allowed.

Upload method so far:
Code:
private function _doVideoUpload($dir)
{
    $config['upload_path'] = './assets/img/objects/'.$dir.'/';
    $config['allowed_types'] = 'jpg|png|webm|ogv|ogg|mp4';
    $config['max_size'] = '10485760'; // 10Mb
    $config['max_width']  = '5000';
    $config['max_height']  = '5000';
    
    $this->load->library('upload', $config);
    
    foreach($_FILES as $field => $file)
    {            
        // No problems with the file
        if($file['error'] == 0) {
            // So lets upload
            if ($this->upload->do_upload($field)) {
                $data = $this->upload->data();
                print_r($data);
            } else {
                $errors = $this->upload->display_errors();
                echo($errors.' - '.print_r($file,true));
            }
        }
        else {
            echo($field.' - error');
        }
    }

}

Updated mimes.php with the following:
Code:
'ogg'   =>  'application/ogg',
'ogv'   =>  'video/ogg',

Like I said, the .jpg, .webm and .mp4 file all upload fine - just not the .ogv?

When i dump out $_FILES i get the following:
Code:
(
    [name] => small.ogv
    [type] => video/ogg
    [tmp_name] => /private/var/tmp/php7L6prB
    [error] => 0
    [size] => 438268
)

I've since taken the other files out of the upload form so i'm just dealing with the .ogv file for now. Also, FYI i'm running this locally and i have the following settings in my php.ini
Code:
max_file_uploads = 20
upload_max_filesize = 100M
post_max_size = 100M

Any thoughts much appreciated,

thanks
#2

[eluser]Unknown[/eluser]
Ignore my question - problem solved.

I should of set the mime to:

Code:
'ogv'   =>  'application/ogg'




Theme © iAndrew 2016 - Forum software by © MyBB