# Uploading files, audio clips: issue with missing file extension of saved file if audio is encoded with 'audio/webm'

**URL:** <https://community.sendbird.com/t/uploading-files-audio-clips-issue-with-missing-file-extension-of-saved-file-if-audio-is-encoded-with-audio-webm/3972>\
**Category:** JavaScript\
**Created:** [February 18, 2022, 9:56am UTC](https://community.sendbird.com/t/uploading-files-audio-clips-issue-with-missing-file-extension-of-saved-file-if-audio-is-encoded-with-audio-webm/3972 "2022-02-18T09:56:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vibonacci](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vibonacci](https://community.sendbird.com/u/vibonacci)\
**Post date:** [February 18, 2022, 9:56am UTC](https://community.sendbird.com/t/uploading-files-audio-clips-issue-with-missing-file-extension-of-saved-file-if-audio-is-encoded-with-audio-webm/3972/1 "2022-02-18T09:56:00Z")

</div>

When uploading an audio clip, using the [`sendBirdSelectors.getSendFileMessage(store)`](https://sendbird.com/docs/chat/v3/javascript/guides/group-channel#2-send-a-message), encoded with ‘audio/webm’ format, the Sendbird backend stores the file without a file extension. This causes issues when using `<audio>` HTML tag to play said audio clip in browsers, specifically the duration of the audio clip is broken due to the missing file extension.

This does not happen though for audio clips send with ‘audio/mpeg’, ‘audio/m4a’ or ‘audio/ogg’. Those get the correct .mp3, .m4a, .oga extensions which prevents the issue above.

.m4a clip uploaded, plainUrl includes the file extension: .m4a  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/9/9da24e948e2b5ea99beacfb6c4dad389973f7aaa.png)

.ogg clip uploaded: plainUrl includes the file extension: .ogg  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/3/337b8623a7767a477252b35f34bc1b86de8422a8.png)

But the problem: ‘audio/webm’ file. There is no file extension.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/f/f14af05edf066cdf7140cec18f8f35511bcabeab.png)

This is a rather bigger concern, as it would seem, as the default Chrome MediaRecorder option for recording audio uses this format.

Is there a way for these audio files to be saved with a ‘logical’ file extension, when the audio clip sent is using ‘audio/webm’?

---

<div class="post-metadata">

**Author:** ![Ian](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/ian/32/2077_2.png) [@Ian](https://community.sendbird.com/u/Ian)\
**Post date:** [February 23, 2022, 3:54pm UTC](https://community.sendbird.com/t/uploading-files-audio-clips-issue-with-missing-file-extension-of-saved-file-if-audio-is-encoded-with-audio-webm/3972/3 "2022-02-23T15:54:20Z")

</div>

Hey @vibonacci, and thanks for posting to our community!

I am doing some testing here to see if I can recreate the same issue. I’ll update you with my findings.

---

<div class="post-metadata">

**Author:** ![vibonacci](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vibonacci](https://community.sendbird.com/u/vibonacci)\
**Post date:** [February 24, 2022, 12:46am UTC](https://community.sendbird.com/t/uploading-files-audio-clips-issue-with-missing-file-extension-of-saved-file-if-audio-is-encoded-with-audio-webm/3972/4 "2022-02-24T00:46:27Z")

</div>

I realized what the issue is. I was sending (naked) Blob’s to the Sendbird backend using FormData()

Converting them to a File object, with the proper mimeType, i.e. ‘audio/webm’ or ‘audio/ogg’, depending on the file, the proper extension is added.

Sending a File object like this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/6/660869702013aea30d59fae079d51e71b2c7683c.png)

now generates a file with .webm extension.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/e/e52267bfd7f8d6cc8ba738e2e79d41460c3cbc95.png)
