Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Allow audio upload from iPhone

More
3 weeks 10 hours ago #274034 by Jmantysalo
I want iPhone users to allow upload a recorder audio file. At first I got error about m4a extension not allowed. Then I addedd m4a as file type, and now the error is "Sorry, unable to check extension of this file type audio/x-m4a."

I am using LimeSurvey Community Edition Versio 6.16.13+260316. My config.php does not contain magic_database -setting. I think that PHP is quite normal too, no changes on mime magic. OTOH when testing with file-command I get "ISO Media, Apple iTunes ALAC/AAC-LC (.M4A) Audio" from the .m4a file as I guess it should be.

Please Log in to join the conversation.

More
2 weeks 1 day ago #274083 by Jmantysalo
Problem is on application/controllers/UploaderController.php line

$extByMimeType = LSFileHelper::getExtensionByMimeType($_FILES, null);

At least Yii::app()->getConfig('magic_file') is empty at application/core/LSFileHelper.php but I do not know if it should be.

 

Please Log in to join the conversation.

More
2 weeks 1 day ago - 2 weeks 1 day ago #274084 by DenisChenu
In config.php you can add any filetype you want

1. Update config.php :
Code:
,        // Update default LimeSurvey config here
        'magic_file' => ROOT . '/application/config/magic_file.php',

2. create magic_file.php and put it in application/config/ (or elsewhere)
Code:
<?php
return array_merge(
    require('../core/utilsfileExtensions.php'), // Limesurcey framework
    array(
        'audio/x-m4a' => 'm4a'
    )
);

PS : and report the issue to add it in core.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
Last edit: 2 weeks 1 day ago by DenisChenu.

Please Log in to join the conversation.

More
2 weeks 18 hours ago #274089 by Jmantysalo
FYI this was resolved on  bugs.limesurvey.org/view.php?id=20476

The patch is oneliner; however, I don't see where one should have guessed 'audio/x-m4a'.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose