How to Upload mp4 – CodeIgniter mime type

08 July 2011 by Rick ~ 0 Comments 1564 views

If you want to upload a file with CodeIgniter you should read my old post about it first.

Config Arguments

So, if you want to be able to upload mp4 files you have to tweak it a little bit.

When you setup the config arguments, add the allowed type and the max size.

$config['allowed_types'] = 'gif|jpg|png|mp4';  
$config['max_size'] = '1000000000000000'; // whatever you need

Add the mime type mp4 to CodeIgniter

Go to:

/application/config/mimes.php

And add the following value to the $mime array.

'mp4'   =>  'video/mp4',

Now you should be able to upload a mp4 video through a form input ;)

Subscribe by E-mail:

« »
Add a Comment

Use [code] example piece of code [/code] to insert code into your comment.