CodeIgniter → Проблема с загрузкой docx файлов

Проблема: при использовании стандартной библиотеки upload в CodeIgniter 2, при попытке загрузить файл с расширением docx возникает ошибка «Вы пытаетесь загрузить запрещенный тип файла» либо «The filetype you are attempting to upload is not allowed».

Вызывает ошибку: «Вы пытаетесь загрузить запрещенный тип файла» в Firefox.

Пример:

            $this->load->library('upload');
            $config['upload_path'] = 'upload/';
            $config['allowed_types'] = 'docx|doc|rtf';
            $config['max_size']    = '1000';             
            $this->upload->initialize($config);            

            // Успешно загуржен файл
            if ($this->upload->do_upload('file_name'))
            {            
                $data['upload_data'] = $this->upload->data();
                $this->views_lib->render('upload_success_view', $data);
            }

            // Неудачно загружен файл
            else
            {
                $data['error'] = $this->upload->display_errors();
                $this->views_lib->render('upload_view', $data);
            }

Решение:

Поправить файл ./application/config/mimes.php, заменив строку:

'docx'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.document',

на:

'docx'  =>  array('application/x-binary-data', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'),

Возвращаемые MIME-типы в разных браузерах:

application/vnd.openxmlformats-officedocument.wordprocessingml.document — Chrome, IE, Sarafi, Opera

application/x-binary-data — FirefoxRelated: bumgarner funeral home laurinburg, nc, paul vautin siblings, unsolved murders in colorado springs, making wine from thompson seedless grapes, franklin pierce dollar coin no mint mark, paul schneider wife, boat trip banana scene, speed dauerkonsum erfahrung, stabbing in cricklewood today, is vegetable glycerin safe for lube, aurora colorado newspaper obituaries, autobahn police simulator 3 release date, excel tab name based on cell value formula, army cid drug suppression team, fenty foundation vs maybelline fit me shade match,