Workflow cannot convert Word document URLs to File objects #20436

Closed
opened 2026-02-21 20:07:27 -05:00 by yindo · 1 comment
Owner

Originally created by @FengfengLiang1112222 on GitHub (Nov 20, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 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.

Hi team,
I encountered an issue when trying to convert a document URL into a File object inside a Dify workflow.

Background

In my workflow, the input is a document URL.
However, the downstream nodes require the document to be in File format, not URL format.

I attempted several approaches:

  1. Using a custom tool

I tried creating a custom tool that returns a File.
The tool is configured to support both local file upload and URL upload.

However:

The tool only accepts direct file uploads

It does not accept document URLs, even though URL upload is enabled in its configuration

  1. Using the API to convert URL → File

I also tried calling the API directly to obtain a File object.
But the API only returns metadata/parameters, not an actual File object that the workflow can use.

  1. Using the HTTP Request node

I tried using the HTTP request node to download the document via URL and output it as a File.

Results:

✔ PDF URLs work correctly

✘ Word document URLs (.doc / .docx) do not work

The returned response contains:

body: garbled / unreadable binary text

files[]: empty list

This makes it impossible to pass Word documents to downstream workflow nodes.

Expected Behavior

The workflow should be able to convert any document URL (PDF, Word, etc.) into a valid File object.

The HTTP Request node or another built-in mechanism should correctly handle binary file responses.

Actual Behavior

Only PDF documents can be converted successfully.

Word documents return a corrupted body and files[] is always empty.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @FengfengLiang1112222 on GitHub (Nov 20, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [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. Hi team, I encountered an issue when trying to convert a document URL into a File object inside a Dify workflow. Background In my workflow, the input is a document URL. However, the downstream nodes require the document to be in File format, not URL format. I attempted several approaches: 1. Using a custom tool I tried creating a custom tool that returns a File. The tool is configured to support both local file upload and URL upload. However: The tool only accepts direct file uploads It does not accept document URLs, even though URL upload is enabled in its configuration 2. Using the API to convert URL → File I also tried calling the API directly to obtain a File object. But the API only returns metadata/parameters, not an actual File object that the workflow can use. 3. Using the HTTP Request node I tried using the HTTP request node to download the document via URL and output it as a File. Results: ✔ PDF URLs work correctly ✘ Word document URLs (.doc / .docx) do not work The returned response contains: body: garbled / unreadable binary text files[]: empty list This makes it impossible to pass Word documents to downstream workflow nodes. Expected Behavior The workflow should be able to convert any document URL (PDF, Word, etc.) into a valid File object. The HTTP Request node or another built-in mechanism should correctly handle binary file responses. Actual Behavior Only PDF documents can be converted successfully. Word documents return a corrupted body and files[] is always empty. ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 🐞 bugstale labels 2026-02-21 20:07:27 -05:00
yindo closed this issue 2026-02-21 20:07:27 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 20, 2025):

The root cause is that Dify's HTTP Request node uses heuristics to decide if a response is a file, relying on headers like Content-Type and Content-Disposition, and by sampling the response to see if it can be decoded as UTF-8. If the response isn't flagged as a file (for example, if the server doesn't set Content-Disposition: attachment or uses a generic MIME type), Dify treats the response as text, not binary, so the files[] output is empty and the body contains garbled text—even though the raw bytes are present. PDFs usually have clear headers, but Word docs often don't, so they get misclassified and aren't converted to File objects in the workflow [source].

Workarounds:

  • If you control the file server, ensure it sets Content-Disposition: attachment; filename="file.docx" and the correct Content-Type (e.g., application/vnd.openxmlformats-officedocument.wordprocessingml.document) for Word docs.
  • If you can't change the server, use a code node or a backend method like save_remote_url to fetch and save the file, which handles binary data robustly [source].
  • For DOCX processing, add a Document Extractor node after the file is created, since LLM nodes can't process DOCX directly [source].

If you're on an older Dify version, consider upgrading, as some remote file handling bugs have been fixed in recent releases [source]. If you need a no-code solution and the above doesn't work, using a plugin like Textin from the Dify marketplace may help for DOCX extraction.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 20, 2025): <!-- Answer --> The root cause is that Dify's HTTP Request node uses heuristics to decide if a response is a file, relying on headers like Content-Type and Content-Disposition, and by sampling the response to see if it can be decoded as UTF-8. If the response isn't flagged as a file (for example, if the server doesn't set `Content-Disposition: attachment` or uses a generic MIME type), Dify treats the response as text, not binary, so the files[] output is empty and the body contains garbled text—even though the raw bytes are present. PDFs usually have clear headers, but Word docs often don't, so they get misclassified and aren't converted to File objects in the workflow [[source](https://github.com/langgenius/dify/blob/522508df289f531b6dcd1f5b1f9ba98acc6b7fdd/api/core/workflow/nodes/http_request/entities.py#L96-L174)]. Workarounds: - If you control the file server, ensure it sets `Content-Disposition: attachment; filename="file.docx"` and the correct `Content-Type` (e.g., `application/vnd.openxmlformats-officedocument.wordprocessingml.document`) for Word docs. - If you can't change the server, use a code node or a backend method like `save_remote_url` to fetch and save the file, which handles binary data robustly [[source](https://github.com/langgenius/dify/issues/28041)]. - For DOCX processing, add a Document Extractor node after the file is created, since LLM nodes can't process DOCX directly [[source](https://github.com/langgenius/dify/issues/21375)]. If you're on an older Dify version, consider upgrading, as some remote file handling bugs have been fixed in recent releases [[source](https://github.com/langgenius/dify/issues/24292)]. If you need a no-code solution and the above doesn't work, using a plugin like Textin from the Dify marketplace may help for DOCX extraction. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/932b1664-0b6a-41ec-a12e-c8de8bb67539?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/932b1664-0b6a-41ec-a12e-c8de8bb67539?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/932b1664-0b6a-41ec-a12e-c8de8bb67539?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/932b1664-0b6a-41ec-a12e-c8de8bb67539?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/932b1664-0b6a-41ec-a12e-c8de8bb67539?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/932b1664-0b6a-41ec-a12e-c8de8bb67539?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/932b1664-0b6a-41ec-a12e-c8de8bb67539?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/28442)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20436