Rectangle 27 1

php File upload in Codeigniter 3?


$config['upload_path'] = 'uploads/';
$config['allowed_types'] = 'wav';
$config['max_size'] = '1000000';
$this->load->library('upload', $config).
$this->_file_mime_type($_FILES[$field]); var_dump($this->file_type); die();
'wav' => 'audio/x-wav'
 with:
'wav' => array('audio/wav', 'audio/wave', 'audio/x-wav'),

Can you please send me the error which you get.

I have already do that. but get the same error

If you attempt to upload a .wav file (tested in firefox 7.0.1). It will report an error of 'The filetype you are attempting to upload is not allowed.'.

Please check the updated answer.

Then do upload your .wmv file. It would show something like application/octet-stream or whatever. Add that to your mimes.php.

This can be solved by replacing line 68 in application/config/mimes.php

When using the upload library with these config values:

it's work like a charm.

Note