file plugin issues - 1.7.7

Hi all, I'm having a rather strange issue with the file plugin. I'm on 1.7.7 and have another custom plugin that uploads mp3 files. I have a testing site (live host) that uploads and plays them without a major problem, although the zaudio player always reads "connecting". I also have a production site (also live host) with the same exact plugins running the same exact elgg version. However on this site the Mimetype is not getting set correctly during the upload action script.

If I manually set the Mimetype in the action script zaudio will recognize it, but still won't actually play the file. The testing site is on a shared hosting package so I have no real access to how the server is setup. The production site is on a VPS, so I do have access.

My queston is: Is it possible for a server to be setup to not recognize certain Mimetypes?

My .htaccess file has mp3 clearly written in there for Etags, so I'm at a bit of a loss as to why on one site there are no problems, but on another there are problems. (Same hosting company)

Any help appreciated.

  • Ok, so interestingly, I was getting error messages when uploading the files. The action script wasn't setting a container_guid which I guess messed it up a bit. Anyway after setting the container_guid for the uploaded mp3 file Elgg seems to recognize it's Mimetype automatically again.

    However, it still isn't actually playing the file, even though zaudio player appears. I've had this exact same file working on the test site I mentioned above, so it's not an issue with bitrates etc. It's perplexing.

  • Just posting as I'm debugging. For the mp3 file var_dump on $_FILES['upload'] gives me the following:

    array(5) { ["name"]=> string(16) "blind_willie.mp3" ["type"]=> string(0) "" ["tmp_name"]=> string(0) "" ["error"]=> int(1) ["size"]=> int(0) }

    This is happening in both Chrome & Firefox. 

  • PROBLEM SOLVED: For anyone else's reference later on.

    The issue was caused by the upload_limit in php.ini It seems that even though the .htaccess file sets it at 5Mb, the system still reverted to the php.ini which was set at 2Mb. Increasing this to 5Mb via cPanel solved the problem.

    So for those who find that some of their mp3 uploads are not being recognized properly as audio files, it might well be for this reason.

  • If your webserver is running with suPHP, the setting of php variables (like upload_limit) won't work via statements in .htaccess files. Only via php.ini you can change the value of the variables, either via the system-wide main php.ini config file or you would need to add a separate php.ini file for each directory.