![]() |
Mp3 Mime-type? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Mp3 Mime-type? (/showthread.php?tid=16530) |
Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]markanderson993[/eluser] Hello there codeIgniter experts, I am having difficulty with my mp3 mime-type. Some users can upload mp3 files and others can't which leads me to believe that a problem exists with my mime-types for mp3 files. Can you check and make sure I have the correct information? This is what I have. Code: 'mp3' => array('audio/mpeg','audio/mpeg','audio/mpg','audio/x-mpeg','audio/mp3','application/force-download','application/octet-stream'), If you see something I'm missing please respond! Thank you! - Pianoman993 Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]pistolPete[/eluser] You could setup a test upload page for those users in order to get the mime type their browser sent. audio/mpeg appears twice in your list, but that shouldn't cause any trouble. Try adding the following (just copied from a google result): - audio/mpeg3 - audio/x-mpeg-3 - video/mpeg - video/x-mpeg Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]TheFuzzy0ne[/eluser] Great idea! If the file upload fails, see if you can log the mime type (not sure how easy this would be). Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]markanderson993[/eluser] Hmm... Pistol, I added your mime-tags and deleted the duplicate I had in the array. I'll report back if the problem is solved. Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]TheFuzzy0ne[/eluser] For the cause: ./system/application/libraries/MY_Upload.php Code: <?php This should log any unrecognised mime types to ./system/logs/unknown_mimes.log. It should only log any one mime once, so you won't have to sift through lots of lines. Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]markanderson993[/eluser] Fuzzy you never fail to impress me. Dang. Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]markanderson993[/eluser] When running the code I just get one error Quote:Fatal error: Call to undefined function exists() in /home/.../application/libraries/MY_Upload.php on line 35 Any idea how to fix that? Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]TheFuzzy0ne[/eluser] D'oh! Should be "file_exists". I've corrected the code above. Sorry 'bout that... Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]pistolPete[/eluser] Use file_exists() instead of exists(). Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]markanderson993[/eluser] Strange, I added the code and the logs/unknown_mimes.log and attempt to upload non-mp3 files like pdfs but nothing shows up in the log :/ I appreciate all your help on this. |