1

I have been trying to get .arm upload to a website built in codeigniter. I know its not a default mine type so I added it with this:

'amr'   =>  'audio/amr',

but its doesnt seem to be working with that. I also added it to the allowed types. Any idea if amr can be supported and if so what may I be doing wrong?

Josh York
  • 411
  • 1
  • 5
  • 18

1 Answers1

5

You could try looking at system/libraries/Upload.php line 199:
$this->_file_mime_type($_FILES[$field]);
Change that line to
$this->_file_mime_type($_FILES[$field]); var_dump($this->file_type); die();
Now you redo your uploading and see what the actual mime type the browser sent to your server.

One silly and insecure workaround I did was adding that actual mime type to mimes array. But this could change if this question get answered :)

Community
  • 1
  • 1
Rocco
  • 1,087
  • 12
  • 21
  • 1
    Great answer. I did this and it show it as 'application/octet-stream' so I change it to 'amr' => 'application/octet-stream', and it worked perfectly. This also helped me fix another issue I was having with some mp4 not uploading. Thanks :) – Josh York May 25 '12 at 23:57
  • I must remind you again that I don't think this workaround is safe. – Rocco May 26 '12 at 00:00