Welcome Guest, Not a member yet? Register   Sign In
Upload Quicktime file
#1

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
Reply
#2

(This post was last modified: 06-28-2016, 08:47 AM by InsiteFX.)

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

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




Theme © iAndrew 2016 - Forum software by © MyBB