выгрузка docx файла в codeigniter

mimes.php

        'doc'   =>  array('application/msword', 'application/vnd.ms-office'),
'docx'  =>  array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'),
'dot'   =>  array('application/msword', 'application/vnd.ms-office'),
'dotx'  =>  array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
'xlsx'  =>  array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
'word'  =>  array('application/msword', 'application/octet-stream'),

var_dump дает следующий ответ

string(24)"application/octet-stream"

Это мой код контроллера

        if(!empty($_FILES['file_name']))
{
// Profile Pic upload
$config = array();
$config['upload_path']           = 'uploads/file/';
$config['allowed_types']         = 'gif|jpg|png|jpeg|pdf|csv|txt|doc|docx|rar|zip|svg|xml|GIF|JPG|PNG|JPEG|PDF|DOC|XML|DOCX|xls|xlsx|CSV|TXT|SVG';
$config['max_size']              =10000;
$config['max_width']             = 1024;
$config['max_height']            = 1024;
$config['file_ext_tolower']      = true;
$this->load->library('upload', $config, 'profilepic');
$this->profilepic->initialize($config);

if(!$profile_pic = $this->profilepic->do_upload('file_name'))
{
$this->session->set_flashdata('message', $this->upload->display_errors());
}
else
{
$imgname = $this->profilepic->data();
$imgpath = 'uploads/file/'.$imgname['file_name'];
$data['file_name'] = $imgpath;
}
}else{
$this->session->set_flashdata('message',

‘Пожалуйста
Я перепробовал все возможные решения, но не смог добиться успеха. Пожалуйста, предложите.

0

Решение

Я пропустил docx в контроллере, и добавление ‘application / octet-stream’ в docx mimes решает проблему. Спасибо за ваши усилия и время.

1

Другие решения

Других решений пока нет …