View Issue Details

IDProjectCategoryView StatusLast Update
15237Bug reports[All Projects] Survey editingpublic2019-09-18 16:18
ReporterFreshLemonUser Assigned ToDenisChenu  
Status closedResolutionfixed 
Product Version3.17.x 
Target VersionFixed in Version3.17.x 
Summary15237: I can´t Upload 3gpp, amr, aac audio files using File Upload Question

Hello Dear Limesurvey Team, i would like to receive some help with the Limesurvey configuration, i need to upload 3gpp, amr, aac files using a File Upload Question but we coudn´t, each file shows a different error.

i´ve already adjust the configuration on the question:

Question: Upload Files
Type: File upload
Relevance equation: 1
Maximum file size allowed (in KB): 50240
Allowed file types: 3gpp, aac, mpeg, wav, amr, mp4, mp3

aac case: 500: Error interno del servidor - Unable to check mime type of files, please activate FileInfo on server.
3gpp case: Sorry, file type application/octet-stream (extension : bin) is not allowed!
amr case: Sorry, file type application/octet-stream (extension : bin) is not allowed!

I already have enable the fileinfo extensión on php 7.2

fileinfo support enabled
version 1.0.5
libmagic 531

I´ll really appreciate your help i´ve already posted it on the IRC chat and the suggested me to publish it as a bug. Please can you point me on the rigth direction?

Thanks in advanced.

TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 3.17.15+190903
I will donate to the project if issue is resolvedNo
Browser 69.0 Firefox Release September 3, 2019
Database & DB-Versionmariadb-5.5.60-1.el7_5.x86_64
Server OS (if known) Operating System: CentOS Linux 7 (Core) - Architecture: x86-64
Webserver software & version (if known)Server version: Apache/2.4.6 (CentOS) Server built: Jul 29 2019 17:18:49
PHP VersionPHP 7.2.22 (cli) (built: Aug 28 2019 09:29:33) ( NTS )




2019-09-05 16:57

administrator   ~53477

Missing mime types in the code base?



2019-09-05 17:26

reporter   ~53478

ollehar: Sorry, what should i do?



2019-09-05 18:09

developer   ~53479

The 500 error are only here with debug>1 and for super-admin.
Can you upload jpg file ?

The file list is here :
Maybe we need to allow update in config.php ?



2019-09-05 18:10

developer   ~53480

PS : code to get mime :
Used by LimeSurvey :

Maybe … potential big issue , quick solution is to allow disable mime type checking …



2019-09-05 18:19

developer   ~53481

Can you upload here 3 light file aac, 3gp and amr ?

And can you check locally on your server with file --mime-type ?



2019-09-05 20:07

reporter   ~53484

Hello sear DenisChenu: I´ll attaching sample Audio Files,


Uploading an ACC file:

Uploading a m4a file:

Uploading an AMR file:

  • Sorry, file type application/octet-stream (extension : bin) is not allowed!*

Uploading 3gp file:

  • Sorry, file type application/octet-stream (extension : bin) is not allowed! *

Uploading 3gpp file

  • Sorry, file type application/octet-stream (extension : bin) is not allowed!*

In we can find aac and 3gp


mime types:

1.amr 2.aac 3.m4a 4.3gp 5.3gpp

file 1.amr --mime-type

1.amr: application/octet-stream

#file 2.aac --mime-type
2.aac: audio/x-hx-aac-adts

#file 3.m4a --mime-type
3.m4a: audio/mp4

file 4.3gp --mime-type

4.3gp: application/octet-stream

file 5.3gpp --mime-type

5.3gpp: video/3gpp

Thanks in advanced.

Best regards a FreshLemonUser

1.amr (717,446 bytes)
2.aac (327,825 bytes)
3.m4a (55,548 bytes)
4.3gp (96,070 bytes)
5.3gpp (1,724,878 bytes)


2019-09-06 07:39

developer   ~53485

2.aac: audio/x-hx-aac-adts are not inside fileExtensions.php

But the most strange are 5.3gpp: video/3gpp : it know by your server, in fileExtensions …

Send a png or jpg file work or not ? And can you check an .ico file (maybe this one) to upload (and to file --mimetype)

About fileInfo : can you send phpinfo as html file ?



2019-09-06 08:21

developer   ~53486


Your fileinfo is OK …
Error on check .ico file :



2019-09-06 10:22

administrator   ~53487

quick solution is to allow disable mime type checking …

Too insecure IMO.



2019-09-06 10:25

administrator   ~53488

Looks like this is an issue for the Yii team? They need to add the missing mime types in their file.



2019-09-06 10:48

developer   ~53493

@ollehar : no

  1. We can use CFileHelper::getExtensionByMimeType params to use the php file from config
  2. We can use $_ENV MAGIC for mime_type file

Alternate resolution :
1 : we must update call of getExtensionByMimeType : not diffcult.

  1. Tell user to use setenv('MAGIC=isgreatmagicfile'); in manual

It's the reason i make a pull request and not a commit.



2019-09-06 10:51

developer   ~53495

for the alternative fileInfo file

Can you, check with


        'magic_database' => '/usr/share/misc/magic.mgc',
        'magic_file' => '/whereyouputthisfile/fileExtensionsBis.php',

'/usr/share/misc/magic.mgc', ius for fedora, then i think can be same in CentOs



2019-09-06 11:13

partner   ~53498

Correct, CentOS7 "file-libs" uses /usr/share/misc/magic.mgc as well.

For reference the current package of "file-libs".



2019-09-06 11:14

administrator   ~53499

How is the OS magic file relevant if Yii has a hardcoded list anyway?



2019-09-06 11:43

partner   ~53500

@ollehar: I had the impression that Denis wants to implement a override via this pullrequest.



2019-09-06 11:57

developer   ~53501

How is the OS magic file relevant if Yii has a hardcoded list anyway?

PHP7.3 (on Fedora) using PHP7 mimetype file VS /usr/share/misc/magic.mgc (on same fedora)

amr file
application/octet-stream VS audio/amr
aac file : OK for both
m4a : ok for both
application/octet-stream VS audio/amr
3gpp OK for both



2019-09-06 12:07

developer   ~53502

@jelo : need 2 override:

  1. MAGIC database for
  2. fileinfo array (mime type to extension) for

Not the same for both



2019-09-06 12:38

developer   ~53503

Fix committed to master branch:



2019-09-06 14:50

developer   ~53504


Now need updating manual …



2019-09-06 15:08

developer   ~53505

Manual updated

@cdorin : unsure of the best place for config ? Good page, but maybe didn't need a specific title ?



2019-09-18 16:18

administrator   ~53638

Fixed in Release 3.17.17+190918

Related Changesets

LimeSurvey: master ab4bd518

2019-09-06 08:19:33


Details Diff
Dev: Throw error about MimeType only without FileInfo
Dev: related issue 15237
Affected Issues
mod - application/controllers/UploaderController.php Diff File

LimeSurvey: master ebd6eb63

2019-09-06 12:38:38


Committer: LouisGac Details Diff
Fixed issue 15237: Upload 3gpp, amr, aac audio files using File Upload Question (#1318)

Fixed issue 15237: Upload 3gpp, amr, aac audio files using File Upload Question
Dev: allowing to set mime database from config
Dev: allowing to set magic file (extension by magic type)
Dev: review file to check : ico can have image/ mime type (not in system.utils.fileExtensions)
Dev: use config['magic_database'] only if needed
Dev: more comment
Dev: Yii code to LS code (and make CodeFactor and @ollehar happy)
Dev: fix return type (from Yii)
Dev: some other function call fix,
Dev: log as error when can find extension for mime type
Affected Issues
mod - application/config/config-defaults.php Diff File
mod - application/controllers/UploaderController.php Diff File
add - application/core/LSFileHelper.php Diff File

Issue History

Date Modified Username Field Change
2019-09-05 16:37 FreshLemonUser New Issue
2019-09-05 16:57 ollehar Note Added: 53477
2019-09-05 17:26 FreshLemonUser Note Added: 53478
2019-09-05 18:09 DenisChenu Note Added: 53479
2019-09-05 18:10 DenisChenu Note Added: 53480
2019-09-05 18:19 DenisChenu Assigned To => DenisChenu
2019-09-05 18:19 DenisChenu Status new => feedback
2019-09-05 18:19 DenisChenu Note Added: 53481
2019-09-05 20:07 FreshLemonUser File Added: 1.amr
2019-09-05 20:07 FreshLemonUser File Added: 2.aac
2019-09-05 20:07 FreshLemonUser File Added: 3.m4a
2019-09-05 20:07 FreshLemonUser File Added: 4.3gp
2019-09-05 20:07 FreshLemonUser File Added: 5.3gpp
2019-09-05 20:07 FreshLemonUser Note Added: 53484
2019-09-05 20:07 FreshLemonUser Status feedback => assigned
2019-09-06 07:39 DenisChenu Note Added: 53485
2019-09-06 08:21 DenisChenu Changeset attached => LimeSurvey master ab4bd518
2019-09-06 08:21 DenisChenu Note Added: 53486
2019-09-06 10:22 ollehar Note Added: 53487
2019-09-06 10:25 ollehar Note Added: 53488
2019-09-06 10:48 DenisChenu Note Added: 53493
2019-09-06 10:51 DenisChenu Note Added: 53495
2019-09-06 11:13 jelo Note Added: 53498
2019-09-06 11:14 ollehar Note Added: 53499
2019-09-06 11:43 jelo Note Added: 53500
2019-09-06 11:57 DenisChenu Note Added: 53501
2019-09-06 12:07 DenisChenu Note Added: 53502
2019-09-06 12:38 LouisGac Changeset attached => LimeSurvey master ebd6eb63
2019-09-06 12:38 DenisChenu Note Added: 53503
2019-09-06 12:38 DenisChenu Resolution open => fixed
2019-09-06 14:50 DenisChenu Note Added: 53504
2019-09-06 15:08 DenisChenu Status assigned => resolved
2019-09-06 15:08 DenisChenu Fixed in Version => 3.17.x
2019-09-06 15:08 DenisChenu Note Added: 53505
2019-09-18 16:18 lime_release_bot Note Added: 53638
2019-09-18 16:18 lime_release_bot Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing