Post by w2opma » Wed Dec 10, 2014 1:11 am

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

Newbie

Posts

Joined
Wed Dec 10, 2014 1:04 am

Post by MarketInSG » Wed Dec 10, 2014 12:07 pm

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.


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by w2opma » Wed Dec 10, 2014 4:56 pm

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.

Newbie

Posts

Joined
Wed Dec 10, 2014 1:04 am

Post by jurpro » Wed Dec 10, 2014 10:53 pm

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

Cari album edisi luar negeri? Atau dalam negeri juga bisa. Kunjungi saja http://www.sawios.com Semoga bisa membantu. :)


User avatar
Active Member

Posts

Joined
Wed Jun 06, 2012 6:17 pm

Post by w2opma » Thu Dec 11, 2014 10:36 pm

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

Newbie

Posts

Joined
Wed Dec 10, 2014 1:04 am
Who is online

Users browsing this forum: No registered users and 60 guests