Page 1 of 1

Unable to Create Download of MP3 file

Posted: Wed Dec 10, 2014 1:11 am
by w2opma
Hey guys,
i'm unable to create a download file (mp3) via the backend, I always get an "Invalid filetype" error.

I've checked my filetype and MIME Type via PHP it's "audio/mpeg"

I've added "mp3" to the list of allowed filetypes in the server settings tab

I've added varios mime-type to the list of allowed mime-types in the server settings tab

Code: Select all

text/plain
image/png
image/jpeg
image/gif
image/bmp
image/vnd.microsoft.icon
image/tiff
image/svg+xml
application/zip
application/x-rar-compressed
application/x-msdownload
application/vnd.ms-cab-compressed
audio/mpeg
audio/mpeg3
audio/x-mpeg-3
video/mpeg
video/x-mpeg
audio/wav
audio/x-wav
video/quicktime
application/pdf
image/vnd.adobe.photoshop
application/postscript
application/msword
application/rtf
application/vnd.ms-excel
application/vnd.ms-powerpoint
application/vnd.oasis.opendocument.text
application/vnd.oasis.opendocument.spreadsheet
iv'e even added "mp3" into the .php file at admin/controller/common/filemanager.php

Code: Select all

				// Allowed file extension types
				$allowed = array(
					'jpg',
					'jpeg',
					'gif',
					'png',
					'mp3'
				);

				if (!in_array(utf8_strtolower(utf8_substr(strrchr($filename, '.'), 1)), $allowed)) {
					$json['error'] = $this->language->get('error_filetype');
				}

				// Allowed file mime types
				$allowed = array(
					'image/jpeg',
					'image/pjpeg',
					'image/png',
					'image/x-png',
					'image/gif',
					'audio/mpeg'
				);
but it's just not working???

What am I doing wrong, or is this a bug?

cheers

Re: Unable to Create Download of MP3 file

Posted: Wed Dec 10, 2014 12:07 pm
by MarketInSG
are you sure you have the correct mime? That seems like the only thing that would trigger the error and prevent the upload. Alternatively, you can upload it with your FTP directly and then link it through the admin.

Re: Unable to Create Download of MP3 file

Posted: Wed Dec 10, 2014 4:56 pm
by w2opma
Seems like 'I found a solution, I added (just by guessing) the Mime-Type "audio/mp3" to the list and it worked.

Seems like OpenCart does not use the PHP methods "mime_content_type()" or "finfo_file()" to determine the Mime-Type. Maybe it comes from HTTP Request or whatever.

Re: Unable to Create Download of MP3 file

Posted: Wed Dec 10, 2014 10:53 pm
by jurpro
it seems your maximum file only on default capacity wich means only 300kb on your setting system. Try to change the maximum capacity with more then usually mp3 files, on System => Setting => server

Your download mp3 files located on folder: system => downloads directory

Re: Unable to Create Download of MP3 file

Posted: Thu Dec 11, 2014 10:36 pm
by w2opma
No, the maximum file upload setting was already adjusted and working, BTW: you get a different error from OpenCart like "No Upload File" or something when the max upload is too low.

Cheers Mates