XF 2.2 m4a attachment Insert button missing


We have a music-related forum, and a lot of people wanted to add iPhone voice recordings in .m4a format into their posts without having to post to YouTube or some other approved site first, so I enabled .m4a in the allowed attachments.

Things had been going fine with the attach and insert method: attach the file, click the Insert button in the upper left that appears on the attachment icon, and the audio file is playable directly in the post without downloading. Yay!

(Below is the screencap I made to explain the steps to our members at the time I enabled .m4a insertion into posts.)


Except now when we're attaching .m4a files, the insert button isn't appearing. The files attach just fine, and the attachments download and play back just fine, but we're no longer able to get them in the posts. Attachment is it.

Nothing has changed on the back end settings that I can see....but it happens that in between enabling .m4a attachments and when somebody first reported the Insert button as missing, we moved our hosting from SiteGround to KnownHost (a huge improvement, btw). I can't imagine that any changes to settings were made in the transfer, but it's otherwise the only change that we've made, so in case it's relevant, there ya go.

Has the approved workflow for inserting attachments changed? Is there something about .m4a files that's changed? Any ideas for me?

I meant to also mention that the insert button DOES appear with other file formats, including MP3. So it's not that the Insert button has gone away altogether -- just for M4A, which is definitely included in my supported attachments list. I added it myself, and have successfully inserted M4A files before. We just can't anymore (multiple users, browsers, Mac, Win, mobile, etc) and the behavior we're seeing is all the same -- all files are working as expected EXCEPT for the m4a.

Thanks again!
This would require an add-on as it stands, as XenForo doesn't consider the .m4a extension "safe" for inline display. I'm not sure how it would have worked previously unless the extension was different. That said, it might be worth us reconsidering as it's a reasonably common extension and MP4 audio should be broadly supported.
I could have sworn it worked after I added that extension to the approved attachments list, but I'm not an Apple guy myself, so the only m4a I had available was an mp3 I'd converted myself. 🙂 So maybe that was enough to sneak past?

Anyway, yeah, I'd love you to take another look at m4a if you can. A lot of my members who are singing into their iPhones and iPads and going to post that maybe format as easily as they're posting others will thank you and me both. 😊

Thanks again!
This would require an add-on as it stands, as XenForo doesn't consider the .m4a extension "safe" for inline display.
I might be missing smth, but I don't think a full Add-on ist required - a simple addition to config.php should be sufficient:

$c->extend('inlineAudioTypes', function (array $types) {
    $types['m4a'] = 'audio/mp4';

    return $types;
That's good, because I haven't found any add-ons that do this. :-) On the road today, but will try this as soon as I get back tonight! Thanks so much!

Woo-hoo! It works! Thanks so much for the solution! While I'm giving you all the credit, I appreciate that my members think that I'm much smarter than I actually am! :ROFLMAO: You're the man, @Kirby!
Top Bottom