Sometimes, when uploading files using <input>
tag, I encounter problem where the file extension doesn't match with its mime type defined in application/config/mimes.php
. For example when I upload a .doc
file, it turns out that its mime type is actually application/octet-stream
, not application/msword
as expected.
I had this problem sometimes in the past. I did work around by adding application/octet-stream
to .doc
mime array. But is there a proper way to fix it?
I think the browser have force my file's mime type somehow. Is there any kind of HTTP header or html meta tag to prevent this?