Load files as a user input in an Agent #7690

Closed
opened 2026-02-21 18:21:54 -05:00 by yindo · 4 comments
Owner

Originally created by @liyuinfo-wl on GitHub (Jan 13, 2025).

          Hey @crazywoola (and @dosu ),

I am talking about Agents, not workflows / chatflows. This type:
Capture d’écran 2024-12-19 à 09 54 19

I want the user to be able to upload some files there, for instance CSV. How can I do so?

Originally posted by @eliaccess in https://github.com/langgenius/dify/issues/11813#issuecomment-2553115175

I also want to know !!!!

Originally created by @liyuinfo-wl on GitHub (Jan 13, 2025). Hey @crazywoola (and @dosu ), I am talking about Agents, not workflows / chatflows. This type: <img width="211" alt="Capture d’écran 2024-12-19 à 09 54 19" src="https://github.com/user-attachments/assets/9917a8ac-f656-4a74-9a89-b8fee8b9d3f4" /> I want the user to be able to upload some files there, for instance CSV. How can I do so? _Originally posted by @eliaccess in https://github.com/langgenius/dify/issues/11813#issuecomment-2553115175_ I also want to know !!!!
yindo added the 🤖 feat:agent label 2026-02-21 18:21:54 -05:00
yindo closed this issue 2026-02-21 18:21:54 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 13, 2025):

Hey @liyuinfo-wl,

I'm here to help you with any bugs, questions, or contributions. Let's tackle this together!

To enable users to upload files, such as CSV, in a Dify Agent, you can follow these steps:

  1. Enable File Upload in Chat Flow: Go to your application settings and click the 'Features' button. This will allow users to upload up to 10 files (maximum 15MB each) during conversations. The platform supports various file formats, including documents, images, audio, and video.

  2. Add a Document Extractor Node: This node will convert the content of uploaded document files into a format that the language model can understand. Use the sys.files variable as input.

  3. Connect to an LLM Node: Add an LLM (Language Model) node and connect it to the output of the Document Extractor node. For images, you can use the VISION feature in the LLM node.

  4. Add a Response Node: This node will process the output from the LLM node and provide responses based on the file content. Different file types may require specific handling, such as using external data tools for audio or video files.

Additionally, you can implement a CSV file uploader component using React, as demonstrated in the csv-uploader.tsx file. This component handles drag-and-drop functionality, file selection, and file removal, providing a user-friendly interface for uploading CSV files. It uses React hooks and context for state management and notifications, ensuring a seamless user experience [1][2][3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Jan 13, 2025): <!-- Greeting --> Hey @liyuinfo-wl, I'm here to help you with any bugs, questions, or contributions. Let's tackle this together! <!-- Answer --> To enable users to upload files, such as CSV, in a Dify Agent, you can follow these steps: 1. **Enable File Upload in Chat Flow**: Go to your application settings and click the 'Features' button. This will allow users to upload up to 10 files (maximum 15MB each) during conversations. The platform supports various file formats, including documents, images, audio, and video. 2. **Add a Document Extractor Node**: This node will convert the content of uploaded document files into a format that the language model can understand. Use the `sys.files` variable as input. 3. **Connect to an LLM Node**: Add an LLM (Language Model) node and connect it to the output of the Document Extractor node. For images, you can use the VISION feature in the LLM node. 4. **Add a Response Node**: This node will process the output from the LLM node and provide responses based on the file content. Different file types may require specific handling, such as using external data tools for audio or video files. Additionally, you can implement a CSV file uploader component using React, as demonstrated in the `csv-uploader.tsx` file. This component handles drag-and-drop functionality, file selection, and file removal, providing a user-friendly interface for uploading CSV files. It uses React hooks and context for state management and notifications, ensuring a seamless user experience <sup>[[1]](https://github.com/langgenius/dify/issues/11813)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/11549)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=other)</sup>
Author
Owner

@liyuinfo-wl commented on GitHub (Jan 13, 2025):

Hey @liyuinfo-wl,

I'm here to help you with any bugs, questions, or contributions. Let's tackle this together!

To enable users to upload files, such as CSV, in a Dify Agent, you can follow these steps:

  1. Enable File Upload in Chat Flow: Go to your application settings and click the 'Features' button. This will allow users to upload up to 10 files (maximum 15MB each) during conversations. The platform supports various file formats, including documents, images, audio, and video.
  2. Add a Document Extractor Node: This node will convert the content of uploaded document files into a format that the language model can understand. Use the sys.files variable as input.
  3. Connect to an LLM Node: Add an LLM (Language Model) node and connect it to the output of the Document Extractor node. For images, you can use the VISION feature in the LLM node.
  4. Add a Response Node: This node will process the output from the LLM node and provide responses based on the file content. Different file types may require specific handling, such as using external data tools for audio or video files.

Additionally, you can implement a CSV file uploader component using React, as demonstrated in the csv-uploader.tsx file. This component handles drag-and-drop functionality, file selection, and file removal, providing a user-friendly interface for uploading CSV files. It uses React hooks and context for state management and notifications, ensuring a seamless user experience [1][2][3].

To continue talking to Dosu, mention @dosu.

Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

I am talking about Agents, not workflows / chatflows

@liyuinfo-wl commented on GitHub (Jan 13, 2025): > Hey @liyuinfo-wl, > > I'm here to help you with any bugs, questions, or contributions. Let's tackle this together! > > To enable users to upload files, such as CSV, in a Dify Agent, you can follow these steps: > > 1. **Enable File Upload in Chat Flow**: Go to your application settings and click the 'Features' button. This will allow users to upload up to 10 files (maximum 15MB each) during conversations. The platform supports various file formats, including documents, images, audio, and video. > 2. **Add a Document Extractor Node**: This node will convert the content of uploaded document files into a format that the language model can understand. Use the `sys.files` variable as input. > 3. **Connect to an LLM Node**: Add an LLM (Language Model) node and connect it to the output of the Document Extractor node. For images, you can use the VISION feature in the LLM node. > 4. **Add a Response Node**: This node will process the output from the LLM node and provide responses based on the file content. Different file types may require specific handling, such as using external data tools for audio or video files. > > Additionally, you can implement a CSV file uploader component using React, as demonstrated in the `csv-uploader.tsx` file. This component handles drag-and-drop functionality, file selection, and file removal, providing a user-friendly interface for uploading CSV files. It uses React hooks and context for state management and notifications, ensuring a seamless user experience [[1]](https://github.com/langgenius/dify/issues/11813)[[2]](https://github.com/langgenius/dify/issues/11549)[[3]](https://github.com/langgenius/dify/blob/main/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx). > > _To continue talking to [Dosu](https://dosu.dev), mention @dosu._ > > Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/b5d74519-d246-478b-a36e-222ee48d398f?feedback_type=other) I am talking about Agents, not workflows / chatflows
Author
Owner

@crazywoola commented on GitHub (Jan 13, 2025):

Answer
image

Please do not modify this template :) and fill in all the required fields.

If you want to know an answer or want to seek for help please use discussion isntead.

@crazywoola commented on GitHub (Jan 13, 2025): Answer <img width="1714" alt="image" src="https://github.com/user-attachments/assets/4b4a0f3d-5d54-41e0-a84c-24cac46a2bbb" /> Please do not modify this template :) and fill in all the required fields. If you want to know an answer or want to seek for help please use discussion isntead.
Author
Owner

@GRCmade commented on GitHub (Oct 25, 2025):

回答 图像

请不要修改此模板:)并填写所有必填字段。

如果您想知道答案或想寻求帮助,请使用讨论。

how can i use upload file in CHATFLOW page but not in AGENT page ?According to the CHATFLOW page interface, agents currently do not have vision capabilities.?

Image
@GRCmade commented on GitHub (Oct 25, 2025): > 回答 <img alt="图像" width="1714" src="https://private-user-images.githubusercontent.com/100913391/402472559-4b4a0f3d-5d54-41e0-a84c-24cac46a2bbb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjEzOTY1ODMsIm5iZiI6MTc2MTM5NjI4MywicGF0aCI6Ii8xMDA5MTMzOTEvNDAyNDcyNTU5LTRiNGEwZjNkLTVkNTQtNDFlMC1hODRjLTI0Y2FjNDZhMmJiYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMDI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTAyNVQxMjQ0NDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mNTYyZmJkNzEyMzZkMDNhNzVkMGJjOWZmMGI0YzkzY2U1ZmFmMWI4ZGU4YTI4ZTIyYmVlNjBjMGI5ODk3NTE5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.bA0swmlZ3P0c2hJMLd7aXz4UbqalIbWcjGeOPiBOSig"> > > 请不要修改此模板:)并填写所有必填字段。 > > 如果您想知道答案或想寻求帮助,请使用讨论。 how can i use upload file in CHATFLOW page but not in AGENT page ?According to the CHATFLOW page interface, agents currently do not have vision capabilities.? <img width="902" height="397" alt="Image" src="https://github.com/user-attachments/assets/7e96c391-2b99-4bcb-b568-fbdb0b205f55" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7690