Strange Problem Uploading Video to CodeIgniter

I am creating a video site on CodeIgniter (v 2.1.0). Administrators can upload videos through the admin panel. It works fine on my local server. But it does not work on the remote test server. I installed mimes.php to correctly recognize the file type. Allowed file types are fine. But the error message states that the file type is not allowed. Here is my mimes.php:

... 'mp4' => 'video/mp4', 'flv' => 'video/x-flv', 'avi' => 'video/x-msvideo', 'mpeg' => 'video/mpeg', ... 

Activated file types:

 $upload_config['allowed_types'] = 'flv|mp4|avi|mpeg' 

Library loading is initialized with $this->upload->initialize($upload_config); If I do var_dump for $ _FILES, this gives me:

 array(1) { ["video_file"]=> array(5) { ["name"]=> string(48) "test_video_file.mp4" ["type"]=> string(9) "video/mp4" ["tmp_name"]=> string(14) "/tmp/phpwkOICI" ["error"]=> int(0) ["size"]=> int(5668643) } } 

What's bad about it? What turns me on is that the same script works fine on my local machine, but doesn't work on a remote test subdomain. And every debug message looks legal to me. Any help is much appreciated. Thank you and welcome

+6
source share
2 answers

I think this is a bug in version 2.1.0. Try these instructions to fix the problem http://ellislab.com/forums/viewthread/204725/

+1
source

I had the same problem. Having looked at the Apache logs, it turned out to be a PHP setup ... the size of the downloaded file was too large. Therefore, in order not to think about changing the PHP settings on each server, I can start the site, I changed the .htaccess file by adding these two lines:

 php_value upload_max_filesize 10M php_value post_max_size 10M 

Found the answer here: https://www.dokuwiki.org/faq:uploadsize

+1
source

Source: https://habr.com/ru/post/912326/


All Articles