Issue with Content-Type for Audio Upload in Version 1.3.0 #13660

Closed
opened 2026-02-21 19:13:12 -05:00 by yindo · 9 comments
Owner

Originally created by @momopia on GitHub (May 7, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.3.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Issue with Content-Type for Audio Upload in Version 1.3.0
In the previous version of our application, we were able to successfully upload audio files for transcription by setting the Content-Type to multipart/form-data. However, with the recent update to version 1.3.0, we encountered an issue where the Content-Type must be set to audio/mp3 in order to send the audio files. If we attempt to use any other Content-Type, we receive the following error response:
JSON复制
{
"code": "unsupported_audio_type",
"message": "Audio type not allowed.",
"status": 415
}
This change is causing a significant problem for us because we are integrating the speech-to-text functionality into a WeChat Mini Program. Unfortunately, WeChat Mini Programs have strict limitations on the Content-Type values that can be used in network requests. Specifically, the only allowed values are:
multipart/form-data (for file uploads)
application/json (for JSON data)
application/octet-stream (for binary data streams)
Given these constraints, we are unable to set the Content-Type to audio/mp3, which is now required by version 1.3.0 of our application. As a result, we are unable to use the speech-to-text functionality within the WeChat Mini Program.
Request for Assistance: We kindly ask for your help in resolving this issue. Is there a way to configure the API to accept multipart/form-data or application/octet-stream for audio uploads, similar to the previous version? Alternatively, if there is a workaround or an alternative approach that we can use within the constraints of WeChat Mini Programs, we would greatly appreciate your guidance.
Thank you for your attention to this matter. We look forward to your response.

✔️ Expected Behavior

Expected Result:
The API should accept audio uploads with the Content-Type set to multipart/form-data or application/octet-stream, similar to the previous version of the application. This would allow the speech-to-text functionality to work within the constraints of WeChat Mini Programs.

Actual Behavior

Current Result:
The API in version 1.3.0 only accepts audio uploads with the Content-Type set to audio/mp3. Any other Content-Type, including multipart/form-data or application/octet-stream, results in an error response with the code "unsupported_audio_type" and the message "Audio type not allowed." This is problematic because Tencent's WeChat Mini Programs only support the following Content-Type values for network requests:
multipart/form-data (for file uploads)
application/json (for JSON data)
application/octet-stream (for binary data streams)

Originally created by @momopia on GitHub (May 7, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.3.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Issue with Content-Type for Audio Upload in Version 1.3.0 In the previous version of our application, we were able to successfully upload audio files for transcription by setting the Content-Type to multipart/form-data. However, with the recent update to version 1.3.0, we encountered an issue where the Content-Type must be set to audio/mp3 in order to send the audio files. If we attempt to use any other Content-Type, we receive the following error response: JSON复制 { "code": "unsupported_audio_type", "message": "Audio type not allowed.", "status": 415 } This change is causing a significant problem for us because we are integrating the speech-to-text functionality into a WeChat Mini Program. Unfortunately, WeChat Mini Programs have strict limitations on the Content-Type values that can be used in network requests. Specifically, the only allowed values are: multipart/form-data (for file uploads) application/json (for JSON data) application/octet-stream (for binary data streams) Given these constraints, we are unable to set the Content-Type to audio/mp3, which is now required by version 1.3.0 of our application. As a result, we are unable to use the speech-to-text functionality within the WeChat Mini Program. Request for Assistance: We kindly ask for your help in resolving this issue. Is there a way to configure the API to accept multipart/form-data or application/octet-stream for audio uploads, similar to the previous version? Alternatively, if there is a workaround or an alternative approach that we can use within the constraints of WeChat Mini Programs, we would greatly appreciate your guidance. Thank you for your attention to this matter. We look forward to your response. <!-- Failed to upload "528982a17d3f9364be887c4b7cbc239.png" --> <!-- Failed to upload "ca63167975cb54d87286bd93ccf77b8.png" --> ### ✔️ Expected Behavior Expected Result: The API should accept audio uploads with the Content-Type set to multipart/form-data or application/octet-stream, similar to the previous version of the application. This would allow the speech-to-text functionality to work within the constraints of WeChat Mini Programs. ### ❌ Actual Behavior Current Result: The API in version 1.3.0 only accepts audio uploads with the Content-Type set to audio/mp3. Any other Content-Type, including multipart/form-data or application/octet-stream, results in an error response with the code "unsupported_audio_type" and the message "Audio type not allowed." This is problematic because Tencent's WeChat Mini Programs only support the following Content-Type values for network requests: multipart/form-data (for file uploads) application/json (for JSON data) application/octet-stream (for binary data streams)
yindo added the stt & tts label 2026-02-21 19:13:12 -05:00
yindo closed this issue 2026-02-21 19:13:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 7, 2025):

Hello @momopia! I'm Dosu, a bot here to help you solve bugs, answer questions, and guide you on becoming a contributor. I'm here to assist you while we wait for a human maintainer. Let's tackle your issue together!

To resolve the issue with audio uploads in Dify version 1.3.0, you can use the /audio-to-text endpoint, which accepts audio uploads with the Content-Type set to multipart/form-data. This is compatible with WeChat Mini Programs' constraints. You can upload audio files using the file parameter in the request body, and the supported formats include mp3, mp4, mpeg, mpga, m4a, wav, and webm. The file size limit is 15MB. Here's an example of how you can make a request using cURL:

curl -X POST '${props.appDetail.api_base_url}/audio-to-text' \
--header 'Authorization: Bearer {api_key}' \
--form 'file=@localfile;type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm]' \
--form 'user=unique_user_id'

This setup allows you to upload audio files without needing to set the Content-Type to audio/mp3, which is not allowed by WeChat Mini Programs. Instead, you use multipart/form-data for the upload [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 7, 2025): <!-- Greeting --> Hello @momopia! I'm [Dosu](https://dosu.dev), a bot here to help you solve bugs, answer questions, and guide you on becoming a contributor. I'm here to assist you while we wait for a human maintainer. Let's tackle your issue together! <!-- Answer --> To resolve the issue with audio uploads in Dify version 1.3.0, you can use the `/audio-to-text` endpoint, which accepts audio uploads with the Content-Type set to `multipart/form-data`. This is compatible with WeChat Mini Programs' constraints. You can upload audio files using the `file` parameter in the request body, and the supported formats include `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `wav`, and `webm`. The file size limit is 15MB. Here's an example of how you can make a request using cURL: ```bash curl -X POST '${props.appDetail.api_base_url}/audio-to-text' \ --header 'Authorization: Bearer {api_key}' \ --form 'file=@localfile;type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm]' \ --form 'user=unique_user_id' ``` This setup allows you to upload audio files without needing to set the Content-Type to `audio/mp3`, which is not allowed by WeChat Mini Programs. Instead, you use `multipart/form-data` for the upload <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/develop/template/template_chat.en.mdx)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/be11f015-0bdd-4dfd-962c-1557a2a213c7?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/be11f015-0bdd-4dfd-962c-1557a2a213c7?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/be11f015-0bdd-4dfd-962c-1557a2a213c7?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/be11f015-0bdd-4dfd-962c-1557a2a213c7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/be11f015-0bdd-4dfd-962c-1557a2a213c7?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/be11f015-0bdd-4dfd-962c-1557a2a213c7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/be11f015-0bdd-4dfd-962c-1557a2a213c7?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (May 7, 2025):

Can you try v1.3.1?

@crazywoola commented on GitHub (May 7, 2025): Can you try v1.3.1?
Author
Owner

@momopia commented on GitHub (Jun 12, 2025):

Can you try v1.3.1?

I’ve tried from version 1.3.0 all the way up to version 1.4.2, but the problem still hasn’t been solved.

@momopia commented on GitHub (Jun 12, 2025): > Can you try v1.3.1? I’ve tried from version 1.3.0 all the way up to version 1.4.2, but the problem still hasn’t been solved.
Author
Owner

@fsea commented on GitHub (Jun 19, 2025):

Image

"code": "unsupported_audio_type",
"message": "Audio type not allowed.",
"status": 415

问题依旧存在

@fsea commented on GitHub (Jun 19, 2025): ![Image](https://github.com/user-attachments/assets/36ce352c-a8be-41f7-9fa0-4933c8ece234) "code": "unsupported_audio_type", "message": "Audio type not allowed.", "status": 415 问题依旧存在
Author
Owner

@wangi4myself commented on GitHub (Jul 7, 2025):

我也一样

@wangi4myself commented on GitHub (Jul 7, 2025): 我也一样
Author
Owner

@laogui commented on GitHub (Jul 23, 2025):

这个问题依然存在

@laogui commented on GitHub (Jul 23, 2025): 这个问题依然存在
Author
Owner

@nikhil-superr commented on GitHub (Sep 9, 2025):

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.[x] I have searched for existing issues search for existing issues, including closed ones.[x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).[x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)[x] Please do not modify this template :) and fill in all the required fields.

Dify version

1.3.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Issue with Content-Type for Audio Upload in Version 1.3.0 In the previous version of our application, we were able to successfully upload audio files for transcription by setting the Content-Type to multipart/form-data. However, with the recent update to version 1.3.0, we encountered an issue where the Content-Type must be set to audio/mp3 in order to send the audio files. If we attempt to use any other Content-Type, we receive the following error response: JSON复制 { "code": "unsupported_audio_type", "message": "Audio type not allowed.", "status": 415 } This change is causing a significant problem for us because we are integrating the speech-to-text functionality into a WeChat Mini Program. Unfortunately, WeChat Mini Programs have strict limitations on the Content-Type values that can be used in network requests. Specifically, the only allowed values are: multipart/form-data (for file uploads) application/json (for JSON data) application/octet-stream (for binary data streams) Given these constraints, we are unable to set the Content-Type to audio/mp3, which is now required by version 1.3.0 of our application. As a result, we are unable to use the speech-to-text functionality within the WeChat Mini Program. Request for Assistance: We kindly ask for your help in resolving this issue. Is there a way to configure the API to accept multipart/form-data or application/octet-stream for audio uploads, similar to the previous version? Alternatively, if there is a workaround or an alternative approach that we can use within the constraints of WeChat Mini Programs, we would greatly appreciate your guidance. Thank you for your attention to this matter. We look forward to your response.

✔️ Expected Behavior

Expected Result: The API should accept audio uploads with the Content-Type set to multipart/form-data or application/octet-stream, similar to the previous version of the application. This would allow the speech-to-text functionality to work within the constraints of WeChat Mini Programs.

Actual Behavior

Current Result: The API in version 1.3.0 only accepts audio uploads with the Content-Type set to audio/mp3. Any other Content-Type, including multipart/form-data or application/octet-stream, results in an error response with the code "unsupported_audio_type" and the message "Audio type not allowed." This is problematic because Tencent's WeChat Mini Programs only support the following Content-Type values for network requests: multipart/form-data (for file uploads) application/json (for JSON data) application/octet-stream (for binary data streams)

@nikhil-superr commented on GitHub (Sep 9, 2025): > ### Self Checks > * [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).[x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.[x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)).[x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)[x] Please do not modify this template :) and fill in all the required fields. > > ### Dify version > 1.3.0 > > ### Cloud or Self Hosted > Self Hosted (Docker) > > ### Steps to reproduce > Issue with Content-Type for Audio Upload in Version 1.3.0 In the previous version of our application, we were able to successfully upload audio files for transcription by setting the Content-Type to multipart/form-data. However, with the recent update to version 1.3.0, we encountered an issue where the Content-Type must be set to audio/mp3 in order to send the audio files. If we attempt to use any other Content-Type, we receive the following error response: JSON复制 { "code": "unsupported_audio_type", "message": "Audio type not allowed.", "status": 415 } This change is causing a significant problem for us because we are integrating the speech-to-text functionality into a WeChat Mini Program. Unfortunately, WeChat Mini Programs have strict limitations on the Content-Type values that can be used in network requests. Specifically, the only allowed values are: multipart/form-data (for file uploads) application/json (for JSON data) application/octet-stream (for binary data streams) Given these constraints, we are unable to set the Content-Type to audio/mp3, which is now required by version 1.3.0 of our application. As a result, we are unable to use the speech-to-text functionality within the WeChat Mini Program. Request for Assistance: We kindly ask for your help in resolving this issue. Is there a way to configure the API to accept multipart/form-data or application/octet-stream for audio uploads, similar to the previous version? Alternatively, if there is a workaround or an alternative approach that we can use within the constraints of WeChat Mini Programs, we would greatly appreciate your guidance. Thank you for your attention to this matter. We look forward to your response. > > ### ✔️ Expected Behavior > Expected Result: The API should accept audio uploads with the Content-Type set to multipart/form-data or application/octet-stream, similar to the previous version of the application. This would allow the speech-to-text functionality to work within the constraints of WeChat Mini Programs. > > ### ❌ Actual Behavior > Current Result: The API in version 1.3.0 only accepts audio uploads with the Content-Type set to audio/mp3. Any other Content-Type, including multipart/form-data or application/octet-stream, results in an error response with the code "unsupported_audio_type" and the message "Audio type not allowed." This is problematic because Tencent's WeChat Mini Programs only support the following Content-Type values for network requests: multipart/form-data (for file uploads) application/json (for JSON data) application/octet-stream (for binary data streams)
Author
Owner

@nikhil-superr commented on GitHub (Sep 9, 2025):

does anyone get the solution for this?

@nikhil-superr commented on GitHub (Sep 9, 2025): does anyone get the solution for this?
Author
Owner

@vic-998 commented on GitHub (Sep 24, 2025):

遇到了同样的问题;

@vic-998 commented on GitHub (Sep 24, 2025): 遇到了同样的问题;
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13660