CodeIgniter Forums
Upload Quicktime file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Upload Quicktime file (/showthread.php?tid=65582)



Upload Quicktime file - Happy Camper - 06-28-2016

Hi

I am trying to upload a quicktime file (.m4v) but it is failing saying i am trying to upload an invalid file type.

Here is the relevant section from mimes.php

PHP Code:
    'qt'    =>    'video/quicktime',
    
'mov'    =>    'video/quicktime',
    
'm4v'    =>    'video/x-m4v',
    
'mp4'    =>    'video/quicktime',
    
'avi'    =>    array('video/x-msvideo''video/msvideo''video/avi''application/x-troff-msvideo'),
    
'movie'    =>    'video/x-sgi-movie',
    
'mpeg'  =>  array('video/mpeg''video/quicktime'),
    
'mpg'   =>  array('video/mpeg''video/quicktime'),
    
'mp4'   =>  array('video/mp4''video/quicktime'),
    
'mpe'   =>  array('video/mpeg''video/quicktime'),
    
'qt'    =>  'video/quicktime',
    
'mov'   =>  array('video/quicktime''video/mp4'),
    
'avi'   =>  array('video/avi''video/x-msvideo'), 

and here is the relevant section from my controller

PHP Code:
       $config['upload_path'] = 'uploads/';
 
       $config['allowed_types'] = 'jpg|png|m4v|mp4';
 
       $config['max_size'] = 5000000;
 
       $config['encrypt_name'] = TRUE

Can any one spot anything wrong?

Thanks


RE: Upload Quicktime file - InsiteFX - 06-28-2016

You can try to add the mime type to the ./application/config/mimes.php file.

PHP Code:
'm4v' => 'video/x-m4v'

Also try using mp4 or you can use the AddType in an .htaccess file.


RE: Upload Quicktime file - Narf - 06-29-2016

I do see something wrong - you're prepending elements to an array that already includes the same keys.