Gopal Sharma
Gopal Sharma

Reputation: 1

Codeigniter 2.2.2 mime type error

I am using Codeigniter v 2.2.2,

i am uploading videos with .mp4, .3gp, .avi, .rmvb extensions, some extensions are working but some are not .

i have already added the mime types in the config/mimes.php

 'wmv' => array('video/wmv', 'video/x-ms-wmv', 'flv-application/octet-stream', 'application/octet-stream'), 
 'flv' => array('video/flv', 'video/x-flv', 'flv-application/octet-stream', 'application/octet-stream'),
 'mp4' => array('video/mp4', 'application/octet-stream'),
 '3gp' => array('video/3gpp', 'video/x-3gp', 'application/octet-stream'),
 'mpeg' => array('video/mpeg', 'application/octet-stream'),
 'mpg' => array('video/mpeg', 'application/octet-stream'),
 'rmvb'=>array('video/rmvb','application/vnd.rn-realmedia-vbr')

from the above list only .mp4 and .3gp is working correctly and for others the video extension is like "1433760225.vnd.rn-realmedia-vbr".

Is there is any syntax error in mimes.php or something else needs to be done.

Upvotes: 0

Views: 494

Answers (1)

Mehul Patel
Mehul Patel

Reputation: 129

File upload is also based on OS you are currently using. If Ubuntu then mime type will be different then windows OS. Try adding 'application/octet-stream' with each extension. It should work

Upvotes: 1

Related Questions