Custom Tools With multipart/forms Content #7756

Closed
opened 2026-02-21 18:22:13 -05:00 by yindo · 3 comments
Owner

Originally created by @thiner on GitHub (Jan 16, 2025).

Self Checks

  • 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.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

I built a custom tool which allows upload file to the API. I tested in PostMan, it's working as expected. When I trying to call the API in Dify workflow, it fails the request with response "415". Screenshot as below:
image
I seems Dify custom tools only accept json format request body, I'd like to see it accept uploaded files as well.

2. Additional context or comments

Postman request:

curl --request POST \
  --url http://localhost:5000/documents \
  --header 'Authorization: Bearer app-xxxx' \
  --header 'Content-Type: multipart/form-data' \
  --form 'file=@202204.pdf' \
  --form type=upload

My workflow for your reference:
image

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @thiner on GitHub (Jan 16, 2025). ### Self Checks - [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. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. I built a custom tool which allows upload file to the API. I tested in PostMan, it's working as expected. When I trying to call the API in Dify workflow, it fails the request with response "415". Screenshot as below: ![image](https://github.com/user-attachments/assets/68c0e840-9343-42f8-9c47-011eb68ed161) I seems Dify custom tools only accept json format request body, I'd like to see it accept uploaded files as well. ### 2. Additional context or comments Postman request: ``` curl --request POST \ --url http://localhost:5000/documents \ --header 'Authorization: Bearer app-xxxx' \ --header 'Content-Type: multipart/form-data' \ --form 'file=@202204.pdf' \ --form type=upload ``` My workflow for your reference: ![image](https://github.com/user-attachments/assets/d3f43c1f-f296-452b-8c3b-b19c03320adb) ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 🔨 feat:tools🌊 feat:workflow labels 2026-02-21 18:22:13 -05:00
yindo closed this issue 2026-02-21 18:22:13 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 16, 2025):

Hi, @thiner. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You encountered a "415" error when using a custom tool for file uploads in a Dify workflow.
  • The tool works in Postman, indicating a potential issue with Dify's support for request body formats.
  • You requested support for multipart/form-data to enable file uploads in Dify workflows.
  • There have been no further comments or developments on this issue.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of the Dify repository by commenting here.
  • If there is no further activity, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Feb 16, 2025): Hi, @thiner. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You encountered a "415" error when using a custom tool for file uploads in a Dify workflow. - The tool works in Postman, indicating a potential issue with Dify's support for request body formats. - You requested support for multipart/form-data to enable file uploads in Dify workflows. - There have been no further comments or developments on this issue. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of the Dify repository by commenting here. - If there is no further activity, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Author
Owner

@thiner commented on GitHub (Feb 16, 2025):

Yes, the new version still not supporting multipart/form-data content type.

@thiner commented on GitHub (Feb 16, 2025): Yes, the new version still not supporting multipart/form-data content type.
Author
Owner

@dosubot[bot] commented on GitHub (Feb 16, 2025):

@takatost, the user @thiner has confirmed that the new version still does not support the multipart/form-data content type for file uploads in Dify workflows. Could you please assist them with this issue?

@dosubot[bot] commented on GitHub (Feb 16, 2025): @takatost, the user @thiner has confirmed that the new version still does not support the multipart/form-data content type for file uploads in Dify workflows. Could you please assist them with this issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7756