mp3 file uploads elgg 1.7.15

Hello all I have a issue with mp3 files not displaying as mp3 music but instead it displays as a document.

I have seen a few disussions about this on the site but I feel my problem is a bit diffrent.

Heres my findings

I have installed elgg 1.7.15 on a dedicated server and uploaded mp3s, the files were visible as mp3 music and I was able to listen to them via aaudio wiget.

I install elgg 1.7.15 same as above onto a shared server with unlimited storage space and bandwidth but when I upload mp3s this time the file icon displays as a document.

Furthermore I decided to clone the original installation from the dedicated server onto the shared server just as a procation in case it was something that I did wrong. After installing the clone on the shared server I checked the files and vollah it was still displaying the mp3 as a music file at this point I thought it was sorted but little did I know when I uploaded another mp3 it started displaying the file as a document again.

Can anyone tell what the cause of this issue is or does anyone else have this problem.

 

Regards

Taner

  • Which version of PHP do you have installed on your server? A user had this problem before, and was solved by installing the latest php 5.3.x on his server. Check it out:

    http://community.elgg.org/discussion/view/876007/mime-types-patch-mp3-like-textplain-on-elgg-185-?annoff=25

     

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • To sum up what's I wrote in the other thread:

    • the problem is not caused by Elgg but by php, because Elgg uses just php methods to identify MIME type,
    • the problem with identifying mp3s correctly seems to be mp3 files that contain id tags,
    • there are several php methods used by Elgg, but the best method (apparently best...) requires php 5.3 to be installed on the server and also the php extension php-fileinfo (which is only available in php 5.3). if the preferred method can't be used the fallback methods will be used with slightly less chances of identifying the file correctly.

    What you can do:

    • check which version of php is installed on your dedicated server and on the shared server. Could the php version cause the issue as I explained above,
    • if possible upgrade / let upgrade php on the shared server and install / let install php-fileinfo php extension.
  • Hello iinly thank you for your reply. I checked my server and it's running php 5.3.. I tried switching back to 5.2 and uploading mp3 it didn't work. I switched back to 5.3 and the mp3 upload still showing as document.

    I have contacted my server support service, will update the out come here.

     

    Thanks

  • Host providers told me that the extension php-fileinfo if definatley installed but still same problem not seeing the file as mp3.

    Just to satisfy myself I installed a copy of elgg 1.8.x on the same server and uploaded the same mp3 and this is working without a problem and I can listen to the mp3 in the files of the site.

     

    Any help would be apriciated as this is driving me crazy. I would have switched to 1.8.x but need to use quite a few plugins that arent avalible for this virsion yet.

  • This is very browser and server depedent. I do not recommend switching to PHP 5.2 - that's not going to solve the problem.

  • Ive tried uploading from diffrent browsers still no joy but its a bit funny that the mp3s work on the 1.8 platform and not on the 1.7  on the same server. Does this not suggest that it's not a server issue?

     

  • Elgg 1.8 uses fileinfo and Elgg 1.7 does not.

  • Thanks cash is there anything that you can suggest? as I mentioned above I installed the 1.7.15 on a dedicated server from another provider and it's working on that site but just can't get it to work on this shared server, running php 5.3 and extension php-fileinfo.

     

    Any suggestion will be aprciated.

  • You could read up on this here: http://www.php.net/manual/en/function.finfo-file.php

    I find working with mime types of be frustrating.

     

  • I don't know exactly how Elgg 1.7 does mime type identification (not exactly for Elgg 1.8 either...). But I think that Elgg 1.8 has three different methods implemented. The first method is using fileinfo extention. So, if Elgg 1.7 has the fileinfo method not implemented there might still be two other methods available - I guess Cash could provide better information here. Maybe it works for you on the dedicated server because both detection methods can be used on the server (especially the successful method) while there is only one method useable on the shared server - and this method is less successful.

    I don't know if it would be possible to backport the fileinfo mime handling from Elgg 1.8 to Elgg 1.7. I think it might be possible if only a few lines of code need to be added at one file. You might want to look through the core code a bit and to compare the code of Elgg 1.7 and Elgg 1.8 to find out what might be needed to backport. I think you could start in the upload handling routines of the file plugin and a bit into zaudio. Then you should be able to find out in which functions the mime type identification is done.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking