kura kura - 1 year ago 163
PHP Question

Upload Video File with Codeigniter

Hy Guys,,

I have problem for upload video file with codeigniter 3. we using server with linux server ubuntu 15.04. this is script controller for upload:

$config['upload_path'] = './uploads/videos/';
$config['allowed_types'] = 'mp4';
$config['max_size'] = 0;
$config['overwrite'] = FALSE;
$config['remove_spaces'] = TRUE;

and configuration php.ini :

post_max_size = 20000M
upload_max_filesize = 20000M

but we still error message "The uploaded file exceeds the maximum allowed size in your PHP configuration file"

please your advice guys, thx

Answer Source

Try this one
Inside the config/mimes.php add the missing file type you are going to uplaod, something like bellow.

    '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'),
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download