always failed when upload large file in dify workflow #19909

Closed
opened 2026-02-21 20:04:53 -05:00 by yindo · 3 comments
Owner

Originally created by @fanfan-lucky on GitHub (Oct 24, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.4.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I setup a workflow and need to upload a large audio file(.mp3) which is about >30M, but there is "uploaded failed, please re-upload" that displayed in frontend web. I already change configuration in .env file,
just as below:
WORKFLOUPLOAD_FILE_SIZE_LIMIT=100
UPLOAD_FILE_SIZE_LIMIT=100
UPLOAD_AUDIO_FILE_SIZE_LIMIT=100

✔️ Expected Behavior

Upload can be success

Actual Behavior

No response

Originally created by @fanfan-lucky on GitHub (Oct 24, 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] 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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.4.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I setup a workflow and need to upload a large audio file(.mp3) which is about >30M, but there is "uploaded failed, please re-upload" that displayed in frontend web. I already change configuration in .env file, just as below: WORKFLOUPLOAD_FILE_SIZE_LIMIT=100 UPLOAD_FILE_SIZE_LIMIT=100 UPLOAD_AUDIO_FILE_SIZE_LIMIT=100 ### ✔️ Expected Behavior Upload can be success ### ❌ Actual Behavior _No response_
yindo added the 🐞 bugoutdated labels 2026-02-21 20:04:53 -05:00
yindo closed this issue 2026-02-21 20:04:53 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 24, 2025):

Large file uploads in Dify (self-hosted, Docker) can fail even after increasing limits in your .env file if the Nginx reverse proxy is not also configured to allow larger uploads. Make sure you set the NGINX_CLIENT_MAX_BODY_SIZE environment variable in your .env file to match or exceed your largest allowed file size (e.g., NGINX_CLIENT_MAX_BODY_SIZE=100M). After changing this, fully restart your Docker containers with docker-compose down && docker-compose up -d to apply the new settings.

Also, double-check that your port mapping in docker-compose.yml exposes the file server port (default 5001) to your host, and that INTERNAL_FILES_URL is unset or blank while FILES_URL points to your host's LAN IP and port (not localhost) for external accessibility. You can verify the environment variables inside your running containers with docker exec <container> env to ensure the correct values are loaded.

All file size limits in Dify are ultimately sourced from environment variables and enforced in the backend code—there are no hardcoded backend limits overriding your settings. If you follow these steps, large file uploads should work as expected.
Reference 1 | Reference 2

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 (Oct 24, 2025): <!-- Answer --> Large file uploads in Dify (self-hosted, Docker) can fail even after increasing limits in your .env file if the Nginx reverse proxy is not also configured to allow larger uploads. Make sure you set the `NGINX_CLIENT_MAX_BODY_SIZE` environment variable in your `.env` file to match or exceed your largest allowed file size (e.g., `NGINX_CLIENT_MAX_BODY_SIZE=100M`). After changing this, fully restart your Docker containers with `docker-compose down && docker-compose up -d` to apply the new settings. Also, double-check that your port mapping in `docker-compose.yml` exposes the file server port (default 5001) to your host, and that `INTERNAL_FILES_URL` is unset or blank while `FILES_URL` points to your host's LAN IP and port (not `localhost`) for external accessibility. You can verify the environment variables inside your running containers with `docker exec <container> env` to ensure the correct values are loaded. All file size limits in Dify are ultimately sourced from environment variables and enforced in the backend code—there are no hardcoded backend limits overriding your settings. If you follow these steps, large file uploads should work as expected. [Reference 1](https://github.com/langgenius/dify-docs/issues/341) | [Reference 2](https://github.com/langgenius/dify-docs/issues/471#issuecomment-3344655903) <!-- 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/9d82ca5b-c938-4964-963b-445a1848dbf8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9d82ca5b-c938-4964-963b-445a1848dbf8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9d82ca5b-c938-4964-963b-445a1848dbf8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9d82ca5b-c938-4964-963b-445a1848dbf8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9d82ca5b-c938-4964-963b-445a1848dbf8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9d82ca5b-c938-4964-963b-445a1848dbf8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9d82ca5b-c938-4964-963b-445a1848dbf8?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/27421)
Author
Owner

@fanfan-lucky commented on GitHub (Oct 24, 2025):

After changing FILES_URL=<my_IP>:5001, when I download the output file in frontend web, there is error that "refuse to connect", addrress just like "http://[my_IP](http://my_IP
:5001/files/tools/523cd069-7e01-4f7f-beaa-827cb228eb5b.docx?timestamp=1761298809&nonce=b5af0ef1adafe049ed50e628a5b63e4e&sign=JgLvV6l5aZXInW9DK_vBRiCny670cNKTsj_wriHzMds=&as_attachment=true):5001/files/tools/523cd069-7e01-4f7f-beaa-827cb228eb5b.docx?timestamp=1761298809&nonce=b5af0ef1adafe049ed50e628a5b63e4e&sign=JgLvV6l5aZXInW9DK_vBRiCny670cNKTsj_wriHzMds=&as_attachment=true"

@fanfan-lucky commented on GitHub (Oct 24, 2025): After changing FILES_URL=<my_IP>:5001, when I download the output file in frontend web, there is error that "refuse to connect", addrress just like "http://[my_IP](http://my_IP :5001/files/tools/523cd069-7e01-4f7f-beaa-827cb228eb5b.docx?timestamp=1761298809&nonce=b5af0ef1adafe049ed50e628a5b63e4e&sign=JgLvV6l5aZXInW9DK_vBRiCny670cNKTsj_wriHzMds=&as_attachment=true):5001/files/tools/523cd069-7e01-4f7f-beaa-827cb228eb5b.docx?timestamp=1761298809&nonce=b5af0ef1adafe049ed50e628a5b63e4e&sign=JgLvV6l5aZXInW9DK_vBRiCny670cNKTsj_wriHzMds=&as_attachment=true"
Author
Owner

@dosubot[bot] commented on GitHub (Oct 24, 2025):

The "refuse to connect" error and the malformed download URL (with brackets or markdown syntax) are almost certainly caused by an incorrect FILES_URL value in your .env file. Dify uses FILES_URL as a literal prefix for all file download links—if you set it to something like <my_IP>:5001 or copy a markdown-formatted link, the frontend will generate broken URLs that can't be reached by your browser reference.

To fix this:

  1. Edit your .env file and set FILES_URL to a plain, protocol-inclusive URL, for example:

    FILES_URL=http://192.168.1.100:5001
    

    (replace 192.168.1.100 with your actual server IP; do not use brackets, parentheses, or markdown syntax).

  2. Make sure INTERNAL_FILES_URL is unset or blank.

  3. Confirm that Docker exposes port 5001 to your host. Run docker ps and check for a line like 0.0.0.0:5001->5001/tcp. If not, add

    ports:
      - "5001:5001"
    

    to your docker-compose.yml under the relevant service, then restart your containers.

  4. Restart all Docker containers with:

    docker-compose down
    docker-compose up -d
    
  5. Test direct access to http://<your-ip>:5001/files/ in your browser to confirm network connectivity.

Dify does not sanitize or validate FILES_URL, so any formatting mistake will break downloads reference. Always use a plain, valid URL.

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 (Oct 24, 2025): <!-- Answer --> The "refuse to connect" error and the malformed download URL (with brackets or markdown syntax) are almost certainly caused by an incorrect FILES_URL value in your `.env` file. Dify uses FILES_URL as a literal prefix for all file download links—if you set it to something like `<my_IP>:5001` or copy a markdown-formatted link, the frontend will generate broken URLs that can't be reached by your browser [reference](https://github.com/langgenius/dify/issues/22117). To fix this: 1. Edit your `.env` file and set FILES_URL to a plain, protocol-inclusive URL, for example: ``` FILES_URL=http://192.168.1.100:5001 ``` (replace `192.168.1.100` with your actual server IP; do not use brackets, parentheses, or markdown syntax). 2. Make sure INTERNAL_FILES_URL is unset or blank. 3. Confirm that Docker exposes port 5001 to your host. Run `docker ps` and check for a line like `0.0.0.0:5001->5001/tcp`. If not, add ``` ports: - "5001:5001" ``` to your `docker-compose.yml` under the relevant service, then restart your containers. 4. Restart all Docker containers with: ``` docker-compose down docker-compose up -d ``` 5. Test direct access to `http://<your-ip>:5001/files/` in your browser to confirm network connectivity. Dify does not sanitize or validate FILES_URL, so any formatting mistake will break downloads [reference](https://github.com/langgenius/dify/issues/25456). Always use a plain, valid URL. <!-- 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/2b5535cb-a38d-4b46-9735-4db97c54dbec?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/2b5535cb-a38d-4b46-9735-4db97c54dbec?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/2b5535cb-a38d-4b46-9735-4db97c54dbec?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/2b5535cb-a38d-4b46-9735-4db97c54dbec?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2b5535cb-a38d-4b46-9735-4db97c54dbec?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/2b5535cb-a38d-4b46-9735-4db97c54dbec?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2b5535cb-a38d-4b46-9735-4db97c54dbec?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/27421)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#19909