I am having a problem when using mime types in PHP.
As a security feature, I host any content uploaded to my server by users in a directory outside of public_html. When a user wants to access their downloaded files in a browser, I use a php script to pull a file from a protected folder using readfile and header ('content-type'), a problem that I still only deal with mp3s.
When I try to use this for an mp3 file, the file does not actually play in the browser, but M4As work fine. And this is not every mp3 file, it just seems that when I get the mime type of some mp3 files, php cannot say that they are mp3. MP3s also play fine if I download them, so this is not a problem with the file for review (if the file has the wrong mime type anyway).
How do I make him say they are MP3?
My getFile code is here: codepad.org
Any help would be greatly appreciated, I will even give you some of my tracking files!
source
share