Codeigniter: MP4 Video Upload not working

前端 未结 3 1012
我寻月下人不归
我寻月下人不归 2020-12-19 20:38

I am researching on a problem for long time but still could not find any solution.

I am uploading mp4 file using codeigniter. Before that I added mime type for mp4

相关标签:
3条回答
  • 2020-12-19 21:00

    Finally I got solution of my Problem so I am writing this answer.

    Mostly detection of mime types in local and online server are different.

    In my case, Local server was getting file_type as "video/mp4". But online server was detecting the mime type as 'application/octet-stream'.

    So I added both in array in the mime type list in my config folder:

    'mp4' => array('video/mp4', 'application/octet-stream'),

    Now it works perfectly in both local and online server.

    0 讨论(0)
  • 2020-12-19 21:05

    I depend on video mime file types when we upload video with extension mp4 but in CodeIgniter upload library use php function finfo_file for detect file_type by this function we get other file_type. Ex. I get video/3gpp

    So I changed in config/mimes.php

    'mp4' => array('video/mp4', 'video/3gpp'),

    and its working for me.

    Thanks

    0 讨论(0)
  • 2020-12-19 21:09

    If everything doesn't work, rearrange the allowed type order like this, placing the video format first:

    $config['allowed_types'] = 'mp4|jpg|png|'
    

    It works in my case.

    0 讨论(0)
提交回复
热议问题