I have this code to upload audio files. It works fine in chrome and opera, but when I try to upload an mp3 file in ie or the Windows 10, Edge, it won't work. It will work in those browsers for wav filetype. Here is the pernenant part of the code:
protected $permittedTypes = array(
'audio/mp3',
'audio/wav',
);
protected function checkType($file)
{
if (in_array($file['type'], $this->permittedTypes)) {
return true;
} else {
$this->messages[] = 'is not permitted type of file';
return false;
}
}
I get the message 'is not permitted type of file' only if I try to upload an mp3 file in a non webkit browser. Otherwise, it works fine.
Any help will be greatly appreciated.
I just tried added audio/mpeg to the $protectedTypes array and now it works.