Sending an audio file - the audio file is not being sent as audio

I’m using the chat product’s API platform along with the UIKit. Currently, I’m facing challenges while attempting to send messages with files using formData. During the process, I include both the file name (file_name) and the file type (file_type), however, I’ve noticed that these values aren’t being updated correctly.

I observed that, in the case of voice files, the file type comes in the format “audio/mp3;sbu_type=voice”. However, even when I pass this value in the ‘type’ field, the change isn’t being reflected. When the UIKit receives a message with a voice file, it displays a sound icon along with the file name. Clicking on the icon redirects the user to another page where they can listen to the audio.

Another attempt I made was to send the audio file using the file’s URL, and also passing the ‘file_type’ (audio/mp3;sbu_type=voice) and the ‘file_name’. In this case, the file name and type were altered. However, in the UIKit, the playback icon was shown, but the audio didn’t play correctly.

I’m trying to understand why none of the approaches I’m trying are working. Why isn’t the formData file submission considering the ‘file_type’ and ‘file_name’ values? What would be the appropriate way to send an audio file using formData, so that it’s recognized as a voice file (sbu_type=voice)?