Upload mp3 in media manager

1,413 views
Skip to first unread message

sammy sumer

unread,
Mar 3, 2011, 6:36:28 AM3/3/11
to Joomla! CMS Development
Hi everyone

I have searched a whole day and still can not find a solution.

Can anyone please tell me how can I upload an mp3 file in Joomla
1.5.20

I have added mp3 in the legal file extensions and I have also added
audio/mp3 in MIME type field.

But I always get the File type not supported error.

Any help is greatly appreciated.

Thanks

Sam Moffatt

unread,
Mar 3, 2011, 7:40:21 AM3/3/11
to joomla-...@googlegroups.com
I added the text ",mp3" at the end of the legal extensions list and it
appeared to work fine in 1.5.22 when uploading. Without that it
doesn't work. Perhaps check there isn't a space at the end of put an
extra comma afterwards (e.g. ",mp3,") to ensure the explode works
fine.

Cheers,

Sam Moffatt
http://pasamio.id.au

> --
> You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
> To post to this group, send an email to joomla-...@googlegroups.com.
> To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.
>
>

mba...@flbab.com

unread,
Mar 3, 2011, 9:45:36 AM3/3/11
to joomla-...@googlegroups.com
Sorry to hijack a thread, but it does follow along the lines of using
MP3's in the Media Manager.

I'm working on a component where I'm trying to use the media field type to
work with uploading and selecting MP3's. Looking at the code, it appears
that the view being pulled up by the media field only works with images.
Is there some way to make this work or would I need to hack away at the
appropriate com_media views to do what I am trying to do?

Thanks,
Michael

sammy sumer

unread,
Mar 3, 2011, 6:35:13 PM3/3/11
to Joomla! CMS Development
Thanks Sam

I will try again and let you know what happens

Cheers mate

On Mar 3, 8:40 pm, Sam Moffatt <pasa...@gmail.com> wrote:
> I added the text ",mp3" at the end of the legal extensions list and it
> appeared to work fine in 1.5.22 when uploading. Without that it
> doesn't work. Perhaps check there isn't a space at the end of put an
> extra comma afterwards (e.g. ",mp3,") to ensure the explode works
> fine.
>
> Cheers,
>
> Sam Moffatthttp://pasamio.id.au

Sam Moffatt

unread,
Mar 3, 2011, 6:39:12 PM3/3/11
to joomla-...@googlegroups.com, mba...@flbab.com
Can you create a new thread with more detail because just reading that
I have no idea what you're talking about.

The problem here is the canUpload function in the Media helper class
which is the thing that AFAIK issues the invalid type error preventing
upload along with a few other checks. It shouldn't occur if the file
extension is in the legal or ignored file extensions list however that
clearly isn't the case.

One thing to try is to ensure you do it as a super administrator as
some of the checks are bypassed for admins (e.g. if you can install an
extension you don't need to be prevented uploading a otherwise
legitimate looking file even if the sniffers don't think the mime type
is a match). This check should be immune to that override however but
it might be worth a try if you haven't done it already.

Cheers,

Sam Moffatt
http://pasamio.id.au

sammy sumer

unread,
Mar 3, 2011, 8:56:06 PM3/3/11
to Joomla! CMS Development
Sam

I have a super admin access to the backend and my joomla version is
1.5.22

I tried again and added mp3 to the Legal Extensions (File Types) and
got the following errors.

* JFile::read: Unable to open file: ''
* Warning: Failed to move file!
* Error. Unable to upload file.

However if I add mp3 to the Legal Image Extensions (File Types) I get
the following error

This file type is not supported

Thanks for your help


On Mar 4, 7:39 am, Sam Moffatt <pasa...@gmail.com> wrote:
> Can you create a new thread with more detail because just reading that
> I have no idea what you're talking about.
>
> The problem here is the canUpload function in the Media helper class
> which is the thing that AFAIK issues the invalid type error preventing
> upload along with a few other checks. It shouldn't occur if the file
> extension is in the legal or ignored file extensions list however that
> clearly isn't the case.
>
> One thing to try is to ensure you do it as a super administrator as
> some of the checks are bypassed for admins (e.g. if you can install an
> extension you don't need to be prevented uploading a otherwise
> legitimate looking file even if the sniffers don't think the mime type
> is a match). This check should be immune to that override however but
> it might be worth a try if you haven't done it already.
>
> Cheers,
>
> Sam Moffatthttp://pasamio.id.au
>
> On Fri, Mar 4, 2011 at 12:45 AM,  <mbab...@flbab.com> wrote:
> > Sorry to hijack a thread, but it does follow along the lines of using
> > MP3's in the Media Manager.
>
> > I'm working on a component where I'm trying to use the media field type to
> > work with uploading and selecting MP3's.  Looking at the code, it appears
> > that the view being pulled up by the media field only works with images.
> > Is there some way to make this work or would I need to hack away at the
> > appropriate com_media views to do what I am trying to do?
>
> > Thanks,
> > Michael
>
> >> I added the text ",mp3" at the end of the legal extensions list and it
> >> appeared to work fine in 1.5.22 when uploading. Without that it
> >> doesn't work. Perhaps check there isn't a space at the end of put an
> >> extra comma afterwards (e.g. ",mp3,") to ensure the explode works
> >> fine.
>
> >> Cheers,
>
> >> Sam Moffatt
> >>http://pasamio.id.au
>

Sam Moffatt

unread,
Mar 3, 2011, 8:59:47 PM3/3/11
to joomla-...@googlegroups.com, sammy sumer
Are you able to upload a standard image file like a jpg?
Sam Moffatt
http://pasamio.id.au

sammy sumer

unread,
Mar 3, 2011, 9:23:33 PM3/3/11
to Joomla! CMS Development
Yes

I am web developer and very comfortable with Joomla!. But this is the
first time I had to upload mp3 in the media manager.

On Mar 4, 9:59 am, Sam Moffatt <pasa...@gmail.com> wrote:
> Are you able to upload a standard image file like a jpg?
> Sam Moffatthttp://pasamio.id.au

Sam Moffatt

unread,
Mar 4, 2011, 7:43:15 AM3/4/11
to joomla-...@googlegroups.com, sammy sumer
I mean have you tried through the media manager to upload an image
file and is it successful on this site? You shouldn't be seeing those
JFile warnings as they indicate an error somewhere...

Sam Moffatt
http://pasamio.id.au

sammy sumer

unread,
Mar 4, 2011, 6:31:14 PM3/4/11
to Joomla! CMS Development
Yes Sam, I have uploaded images through media manager. All with no
problem at all.

It is just the mp3 that is causing these errors.

Thank you so much for your help

SaMMY

On Mar 4, 8:43 pm, Sam Moffatt <pasa...@gmail.com> wrote:
> I mean have you tried through the media manager to upload an image
> file and is it successful on this site? You shouldn't be seeing those
> JFile warnings as they indicate an error somewhere...
>

Sam Moffatt

unread,
Mar 4, 2011, 9:54:39 PM3/4/11
to joomla-...@googlegroups.com, sammy sumer
How big is the MP3 and what is the php max_post_size and upload_max_filesize?

Sam Moffatt
http://pasamio.id.au

sammy sumer

unread,
Mar 5, 2011, 6:41:10 AM3/5/11
to Joomla! CMS Development

This is a good point. The mp3 is 3.5MB.

I will check those settings and I try to increase the limits with a
custom php.ini file.

I let you know the results.

Thanks for your help mate

On Mar 5, 10:54 am, Sam Moffatt <pasa...@gmail.com> wrote:
> How big is the MP3 and what is the php max_post_size and upload_max_filesize?
>
> Sam Moffatthttp://pasamio.id.au

sammy sumer

unread,
Mar 7, 2011, 8:16:15 PM3/7/11
to Joomla! CMS Development
Thanks Sam, That was it. The problem was with the upload_max_filesize.

I added the php_value upload_max_filesize 8M in htaccess and the
problem went away.

Thank you so much

SaMMY

On Mar 5, 10:54 am, Sam Moffatt <pasa...@gmail.com> wrote:
> How big is the MP3 and what is the php max_post_size and upload_max_filesize?
>
> Sam Moffatthttp://pasamio.id.au
Reply all
Reply to author
Forward
0 new messages