![]() |
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]TheFuzzy0ne[/eluser] Hmmm. Is the file in the logs directory at all? Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]pistolPete[/eluser] file() normally returns an array whose entries contain the line endings, therefore in_array() probably won't ever return true. Code: (...) Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]TheFuzzy0ne[/eluser] It should be: Code: if ( ! in_array($mime, $file)) I've corrected it above again. EDIT: I think I'm forgetting the 8 Ps ![]() Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]markanderson993[/eluser] Ah ok. I'll try that! Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]markanderson993[/eluser] Uh oh! An error! Quote:A PHP Error was encountered this is the code as of now right? Code: <?php Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]TheFuzzy0ne[/eluser] I thought that mime was the mime type of the current file, not an array of mimes. I've changed the code again. If you get any more errors, I'll just create a controller and test it myself. EDIT: On second thoughts, I can see that's not going to work either. Gonna go get some food, and then I'll write some code, and test it. EDIT 2: On third thoughts, try it out, I think I fixed it. If not, then I'll fix and test it. Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]markanderson993[/eluser] Now I don't get any errors but nothing is being added to the log. :/ Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]TheFuzzy0ne[/eluser] Please see my previous edit (EDIT 2) ![]() Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]markanderson993[/eluser] I hate being so harsh on you but your gonna have to get some food then test it. I still tried it with no luck, nothing showed up in the log :/ Mp3 Mime-type? - El Forum - 03-09-2009 [eluser]TheFuzzy0ne[/eluser] OK, the code is now tested and confirmed as working. Some file do not have mime types, so you will see a line saying "No Mime Type!" in the log file if one or more of these files is submitted. |