Error in File ingestion in external api using HTTP Request node #6257

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

Originally created by @muckthaa-ss on GitHub (Oct 23, 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

Cloud

Steps to reproduce

I upload a file in the HTTP request body, but it returns an error saying unsupported file format.
Example, I upload a .pdf file and the external api for ingestion handles .pdf and .txt files and for other formats, it throws the "unsupported file format." message.
Screenshot 2024-10-23 115238

✔️ Expected Behavior

File is ingested successfully message in the output.

Actual Behavior

Unsupported file format error.

Originally created by @muckthaa-ss on GitHub (Oct 23, 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 Cloud ### Steps to reproduce I upload a file in the HTTP request body, but it returns an error saying unsupported file format. Example, I upload a .pdf file and the external api for ingestion handles .pdf and .txt files and for other formats, it throws the "unsupported file format." message. ![Screenshot 2024-10-23 115238](https://github.com/user-attachments/assets/29f5db30-7fb5-43ad-bea3-202065b654a9) ### ✔️ Expected Behavior File is ingested successfully message in the output. ### ❌ Actual Behavior Unsupported file format error.
yindo added the 🐞 bug label 2026-02-21 18:14:46 -05:00
yindo closed this issue 2026-02-21 18:14:46 -05:00
Author
Owner

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

The "unsupported file format" error you're encountering might be due to a few potential issues:

  1. File Format Validation: Ensure that the file is indeed a valid PDF. Sometimes, files with a .pdf extension might not be properly formatted as PDFs, leading to validation errors.

  2. Content-Type Header: Verify that the Content-Type header is correctly set to multipart/form-data in your HTTP request. This is crucial for file uploads, as it ensures the server correctly interprets the incoming data [1].

  3. File Size Limitations: Check if the file size exceeds any limits set by the API. The Dify API supports files up to 15MB in size [2].

  4. Correct API Endpoint: Double-check that you are using the correct API endpoint and that it is configured to accept PDF files.

If all these aspects are correctly configured and the issue persists, there might be a need to look into the server-side handling of the file to ensure it is not rejecting the file for any other reason.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 23, 2024): <!-- Answer --> The "unsupported file format" error you're encountering might be due to a few potential issues: 1. **File Format Validation**: Ensure that the file is indeed a valid PDF. Sometimes, files with a `.pdf` extension might not be properly formatted as PDFs, leading to validation errors. 2. **Content-Type Header**: Verify that the `Content-Type` header is correctly set to `multipart/form-data` in your HTTP request. This is crucial for file uploads, as it ensures the server correctly interprets the incoming data <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/http_request/executor.py)</sup>. 3. **File Size Limitations**: Check if the file size exceeds any limits set by the API. The Dify API supports files up to 15MB in size <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/jp/features/datasets/maintain-dataset-via-api.md)</sup>. 4. **Correct API Endpoint**: Double-check that you are using the correct API endpoint and that it is configured to accept PDF files. If all these aspects are correctly configured and the issue persists, there might be a need to look into the server-side handling of the file to ensure it is not rejecting the file for any other reason. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@muckthaa-ss commented on GitHub (Oct 23, 2024):

It is a valid .pdf file and the file is just 422kb.
I have also verified the API endpoint and the header and it is correct.

@muckthaa-ss commented on GitHub (Oct 23, 2024): It is a valid .pdf file and the file is just 422kb. I have also verified the API endpoint and the header and it is correct.
Author
Owner

@crazywoola commented on GitHub (Oct 23, 2024):

Duplicated https://github.com/langgenius/dify/issues/9599

@crazywoola commented on GitHub (Oct 23, 2024): Duplicated https://github.com/langgenius/dify/issues/9599
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6257