File upload related functions cannot be implemented by adding http request nodes. #6209

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

Originally created by @wangyingle666 on GitHub (Oct 21, 2024).

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

0.10.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The content of the document can be read by adding the node of the document extractor, but some documents, such as word, contain tables. Such documents cannot be processed by adding the node of the document extractor, so I want to add the node of the http request. deal with. But I am using node config for http request and I am not able to achieve

This is the interface I wrote:
curl -X 'POST'
'http://172.17.60.18:18207/file_parse/'
-H 'accept: application/json'
-H 'Content-Type: multipart/form-data'
-F 'files=@测试.txt;type=text/plain'

This is the http request node I configured
image

This is done by adding http request node background log as follows, where does this "upload" come from?

image

This is the log directly called through curl
image

✔️ Expected Behavior

I hope to extract complex document content by configuring the http request node to call the interface I wrote to add the attachment function.

Actual Behavior

Configuring the http request interface cannot implement the document upload and parsing function

Originally created by @wangyingle666 on GitHub (Oct 21, 2024). ### 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 0.10.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The content of the document can be read by adding the node of the document extractor, but some documents, such as word, contain tables. Such documents cannot be processed by adding the node of the document extractor, so I want to add the node of the http request. deal with. But I am using node config for http request and I am not able to achieve This is the interface I wrote: curl -X 'POST' \ 'http://172.17.60.18:18207/file_parse/' \ -H 'accept: application/json' \ -H 'Content-Type: multipart/form-data' \ -F 'files=@测试.txt;type=text/plain' This is the http request node I configured ![image](https://github.com/user-attachments/assets/ff439bf6-4e5f-4aec-a1e3-58a93f46ecbe) This is done by adding http request node background log as follows, where does this "upload" come from? ![image](https://github.com/user-attachments/assets/b8e9b0a3-dcf8-4969-90be-925ec296ac53) This is the log directly called through curl ![image](https://github.com/user-attachments/assets/8934948d-d3a2-43f0-8cce-ad975b8534bf) ### ✔️ Expected Behavior I hope to extract complex document content by configuring the http request node to call the interface I wrote to add the attachment function. ### ❌ Actual Behavior Configuring the http request interface cannot implement the document upload and parsing function
yindo added the 🐞 bug label 2026-02-21 18:14:33 -05:00
yindo closed this issue 2026-02-21 18:14:33 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 21, 2024):

To address the issue of file uploads not working as expected with the HTTP request node in Dify, there are a few things to consider:

  1. File Naming Discrepancy: The discrepancy in file names between your curl command and the HTTP request node might be due to how the filename is being set in the HTTP request node. In Dify, the filename is typically derived from the URL's basename or guessed from the content type. If the filename is appearing as "upload" in the HTTP request node, it might be due to the way the file path or name is being specified in the node configuration [1].

  2. Configuration of HTTP Request Node: Ensure that the HTTP request node is correctly configured to handle multipart form-data. The Content-Type should be set to multipart/form-data, and the file should be included in the form-data with the correct key. The BodyData object should have its type set to "file" and the file attribute should point to the correct file path or identifier [2].

  3. Boundary and Headers: The Executor class in Dify handles multipart form-data by setting the Content-Type header with a boundary. Ensure that this is correctly set in your configuration. The boundary is crucial for separating parts of the form data [3].

  4. File Upload Handling: If the HTTP request node is not handling the file upload as expected, double-check the file path and ensure that the file is accessible and correctly specified in the node configuration. Also, verify that the server endpoint is correctly set up to receive multipart form-data and process the file accordingly.

By ensuring these configurations are correct, you should be able to achieve the desired file upload and parsing functionality using the HTTP request node in Dify.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 21, 2024): <!-- Answer --> To address the issue of file uploads not working as expected with the HTTP request node in Dify, there are a few things to consider: 1. **File Naming Discrepancy**: The discrepancy in file names between your curl command and the HTTP request node might be due to how the filename is being set in the HTTP request node. In Dify, the filename is typically derived from the URL's basename or guessed from the content type. If the filename is appearing as "upload" in the HTTP request node, it might be due to the way the file path or name is being specified in the node configuration <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/http_request/node.py)</sup>. 2. **Configuration of HTTP Request Node**: Ensure that the HTTP request node is correctly configured to handle multipart form-data. The `Content-Type` should be set to `multipart/form-data`, and the file should be included in the form-data with the correct key. The `BodyData` object should have its `type` set to `"file"` and the `file` attribute should point to the correct file path or identifier <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/http_request/entities.py)</sup>. 3. **Boundary and Headers**: The `Executor` class in Dify handles multipart form-data by setting the `Content-Type` header with a boundary. Ensure that this is correctly set in your configuration. The boundary is crucial for separating parts of the form data <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/http_request/executor.py)</sup>. 4. **File Upload Handling**: If the HTTP request node is not handling the file upload as expected, double-check the file path and ensure that the file is accessible and correctly specified in the node configuration. Also, verify that the server endpoint is correctly set up to receive multipart form-data and process the file accordingly. By ensuring these configurations are correct, you should be able to achieve the desired file upload and parsing functionality using the HTTP request node in Dify. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@wangyingle666 commented on GitHub (Oct 21, 2024):

I need help ><

@wangyingle666 commented on GitHub (Oct 21, 2024): I need help ><
Author
Owner

@dosubot[bot] commented on GitHub (Nov 22, 2024):

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

Issue Summary

  • You reported challenges with implementing file upload functions using HTTP request nodes in Dify version 0.10.0.
  • The issue specifically involves processing complex documents like Word files with tables.
  • I suggested checking file naming, HTTP request node configuration, multipart form-data handling, and server endpoint setup.
  • You have expressed a need for further assistance.

Next Steps

  • Please let us know if this issue is still relevant to 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 (Nov 22, 2024): Hi, @wangyingle666. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary** - You reported challenges with implementing file upload functions using HTTP request nodes in Dify version 0.10.0. - The issue specifically involves processing complex documents like Word files with tables. - I suggested checking file naming, HTTP request node configuration, multipart form-data handling, and server endpoint setup. - You have expressed a need for further assistance. **Next Steps** - Please let us know if this issue is still relevant to 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6209