How to Upload mp4 – CodeIgniter mime type

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.

Add the mime type mp4 to CodeIgniter

Go to:


And add the following value to the $mime array.

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

6 Responses to “How to Upload mp4 – CodeIgniter mime type”

  1. Cesar January 7, 2013 at 1:25 pm #

    Really useful, exactly solves ‘my problem’.

    Thanks dude.

    • Rick January 7, 2013 at 3:55 pm #

      Glad it worked ! 😉

  2. Matias Fabian Lecaros Aranis March 20, 2013 at 5:11 am #

    hi, any idea on how to establish as a requirement the max duration(time) length for a video?, I’m guessing something like $config[‘max_length’] ><


    • Rick March 20, 2013 at 9:24 am #

      Hi there Matias,

      I don’t think that’s posible.

      CI should be able to read the video file (wich it might require a server side video library).

      However, if you happen to find the answer feel free to post it here. I’d appreciate it 😉


  3. Ketav September 5, 2016 at 8:10 am #

    It works fine..
    Thanks 🙂

    • Rick September 5, 2016 at 12:45 pm #

      You’re welcome!

Leave a Reply

Add <code> Some Code </code> by using this tags.