File upload via Drag & Drop is possible even when the feature is disabled #20692

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

Originally created by @halogen22 on GitHub (Nov 30, 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

v1.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create a chatflow.

  2. Go to Features and disable File Upload.
    Image

  3. Click "Publish" and then "Run App."

  4. Drag and drop an image file from a local directory onto the app interface.
    Image

  5. The image is successfully uploaded.

✔️ Expected Behavior

When the File Upload feature is disabled, image files should not be uploadable, including via drag-and-drop.

Actual Behavior

Image files can be uploaded via drag-and-drop even when the File Upload feature is disabled in the chatflow settings.

Originally created by @halogen22 on GitHub (Nov 30, 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 v1.10.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Create a chatflow. 2. Go to Features and disable File Upload. <img width="320" height="599" alt="Image" src="https://github.com/user-attachments/assets/1cf9f362-2d8e-432a-9fb2-0a93ab23b053" /> 3. Click "Publish" and then "Run App." 4. Drag and drop an image file from a local directory onto the app interface. <img width="779" height="159" alt="Image" src="https://github.com/user-attachments/assets/aadb3342-c511-450e-a65a-ef88831b66e3" /> 5. The image is successfully uploaded. ### ✔️ Expected Behavior When the File Upload feature is disabled, image files should not be uploadable, including via drag-and-drop. ### ❌ Actual Behavior Image files can be uploaded via drag-and-drop even when the File Upload feature is disabled in the chatflow settings.
yindo added the 🐞 bug label 2026-02-21 20:08:30 -05:00
yindo closed this issue 2026-02-21 20:08:30 -05:00
Author
Owner

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

This is a confirmed frontend bug: drag-and-drop file uploads do not check if the File Upload feature is enabled, so files can be uploaded even when the feature is disabled. The standard file upload button is correctly hidden when the feature is off, but the drag-and-drop handler (handleDropFile in web/app/components/base/file-uploader/hooks.ts) always accepts files and calls the upload logic without checking the enabled flag. In contrast, clipboard paste uploads do check fileConfig.enabled before proceeding, which is the correct behavior.

To fix this, add a check for fileConfig.enabled in the drag-and-drop handler, just like in the clipboard paste handler. This will prevent drag-and-drop uploads when the feature is disabled. You can see the relevant code and the missing check here:
web/app/components/base/file-uploader/hooks.ts

No workarounds or patches from the community or maintainers were found. The fix should be straightforward: update the handleDropFile callback to check fileConfig.enabled before calling handleLocalFileUpload.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 30, 2025): <!-- Answer --> This is a confirmed frontend bug: drag-and-drop file uploads do not check if the File Upload feature is enabled, so files can be uploaded even when the feature is disabled. The standard file upload button is correctly hidden when the feature is off, but the drag-and-drop handler (`handleDropFile` in `web/app/components/base/file-uploader/hooks.ts`) always accepts files and calls the upload logic without checking the enabled flag. In contrast, clipboard paste uploads do check `fileConfig.enabled` before proceeding, which is the correct behavior. To fix this, add a check for `fileConfig.enabled` in the drag-and-drop handler, just like in the clipboard paste handler. This will prevent drag-and-drop uploads when the feature is disabled. You can see the relevant code and the missing check here: [web/app/components/base/file-uploader/hooks.ts](https://github.com/langgenius/dify/blob/247069c7e96fa1763fc9dd9da001bc5683c73a64/web/app/components/base/file-uploader/hooks.ts#L50-L372) No workarounds or patches from the community or maintainers were found. The fix should be straightforward: update the `handleDropFile` callback to check `fileConfig.enabled` before calling `handleLocalFileUpload`. <!-- 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/9c1ce6e1-da16-47b2-9589-cfa94a1acc47?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9c1ce6e1-da16-47b2-9589-cfa94a1acc47?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9c1ce6e1-da16-47b2-9589-cfa94a1acc47?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9c1ce6e1-da16-47b2-9589-cfa94a1acc47?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9c1ce6e1-da16-47b2-9589-cfa94a1acc47?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9c1ce6e1-da16-47b2-9589-cfa94a1acc47?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9c1ce6e1-da16-47b2-9589-cfa94a1acc47?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20confirmed%20frontend%20bug%3A%20drag-and-drop%20file%20uploads%20do%20not%20check%20if%20the%20File%20Upload%20feature%20is%20enabled%2C%20so%20files%20can%20be%20uploaded%20even%20when%20the%20feature%20is%20disabled.%20The%20standard%20file%20upload%20button%20is%20correctly%20hidden%20when%20the%20feature%20is%20off%2C%20but%20the%20drag-and-drop%20handler%20%28%60handleDropFile%60%20in%20%60web/app/components/base/file-uploader/hooks.ts%60%29%20always%20accepts%20files%20and%20calls%20the%20upload%20logic%20without%20checking%20the%20enabled%20flag.%20In%20contrast%2C%20clipboard%20paste%20uploads%20do%20check%20%60fileConfig.enabled%60%20before%20proceeding%2C%20which%20is%20the%20correct%20behavior.%0A%0ATo%20fix%20this%2C%20add%20a%20check%20for%20%60fileConfig.enabled%60%20in%20the%20drag-and-drop%20handler%2C%20just%20like%20in%20the%20clipboard%20paste%20handler.%20This%20will%20prevent%20drag-and-drop%20uploads%20when%20the%20feature%20is%20disabled.%20You%20can%20see%20the%20relevant%20code%20and%20the%20missing%20check%20here%3A%20%20%0A%5Bweb/app/components/base/file-uploader/hooks.ts%5D%28https%3A//github.com/langgenius/dify/blob/247069c7e96fa1763fc9dd9da001bc5683c73a64/web/app/components/base/file-uploader/hooks.ts%23L50-L372%29%0A%0ANo%20workarounds%20or%20patches%20from%20the%20community%20or%20maintainers%20were%20found.%20The%20fix%20should%20be%20straightforward%3A%20update%20the%20%60handleDropFile%60%20callback%20to%20check%20%60fileConfig.enabled%60%20before%20calling%20%60handleLocalFileUpload%60.)&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/28945)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20692