[PR #4203] [CLOSED] 💄 Optimize and limit Files upload #21418

Closed
opened 2026-04-20 03:29:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/4203
Author: @Yanyutin753
Created: 7/30/2024
Status: Closed

Base: devHead: file_upload


📝 Commits (10+)

📊 Changes

50 files changed (+551 additions, -77 deletions)

View changed files

📝 backend/apps/rag/main.py (+18 -0)
📝 backend/config.py (+12 -0)
📝 src/lib/apis/rag/index.ts (+2 -0)
📝 src/lib/components/admin/Settings/Documents.svelte (+37 -0)
📝 src/lib/components/chat/Controls/Controls.svelte (+1 -0)
📝 src/lib/components/chat/MessageInput.svelte (+145 -66)
📝 src/lib/components/chat/Messages/UserMessage.svelte (+1 -1)
📝 src/lib/components/common/FileItem.svelte (+17 -2)
📝 src/lib/components/workspace/Documents.svelte (+26 -8)
📝 src/lib/constants.ts (+2 -0)
📝 src/lib/i18n/locales/ar-BH/translation.json (+11 -0)
📝 src/lib/i18n/locales/bg-BG/translation.json (+7 -0)
📝 src/lib/i18n/locales/bn-BD/translation.json (+7 -0)
📝 src/lib/i18n/locales/ca-ES/translation.json (+8 -0)
📝 src/lib/i18n/locales/ceb-PH/translation.json (+7 -0)
📝 src/lib/i18n/locales/de-DE/translation.json (+7 -0)
📝 src/lib/i18n/locales/dg-DG/translation.json (+7 -0)
📝 src/lib/i18n/locales/en-GB/translation.json (+7 -0)
📝 src/lib/i18n/locales/en-US/translation.json (+7 -0)
📝 src/lib/i18n/locales/es-ES/translation.json (+8 -0)

...and 30 more files

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Testing: Have you written and run sufficient tests for validating the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?

Changelog Entry

Description

1. During the file upload process, initialize the file first, so that the response is faster during the upload process.

https://github.com/user-attachments/assets/3fb18878-1453-4920-8cad-4cbda5cb272c

2. Environment variables RAG_MAX_FILE_COUNT and RAG_MAX_FILE_SIZE are also set to limit the maximum size and number of files that users can upload per session, while allowing administrators to freely adjust these values.

image

3. By adjusting the front end, we can make the front end upload files, display the size of each file, and adapt to previous files, which do not display the size of the file

image

image

Warning

image

image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/4203 **Author:** [@Yanyutin753](https://github.com/Yanyutin753) **Created:** 7/30/2024 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `file_upload` --- ### 📝 Commits (10+) - [`557ac29`](https://github.com/open-webui/open-webui/commit/557ac2957b63cf9deafdcfe08135be1be6a7ac74) 💄 新增文件上传大小 - [`c4d5755`](https://github.com/open-webui/open-webui/commit/c4d5755f8a954f5c3fa139b6e9b648e2534d3233) Update UserMessage.svelte - [`1cadf82`](https://github.com/open-webui/open-webui/commit/1cadf827725642972bca30137f88f16dd55de092) 👀 优化成环境变量 - [`274fe67`](https://github.com/open-webui/open-webui/commit/274fe67fac27a2f36619e4734f415bf3cb73d8db) 💄 修复参数和优化样式 - [`b72c98a`](https://github.com/open-webui/open-webui/commit/b72c98aa8d0666c22e7ce4b06a267e24c04e16cd) 💄 修复参数和优化样式 - [`4885f33`](https://github.com/open-webui/open-webui/commit/4885f339d3d7c1b1e8fabe0a717c790e74c1e7e6) 💄 fix format - [`c3272ea`](https://github.com/open-webui/open-webui/commit/c3272ea46a411b205626ed8ec0d4d94fcc394976) 💄 fix format - [`6f94ac0`](https://github.com/open-webui/open-webui/commit/6f94ac0a6b04ca559e4ba0ef39325302341ef2c0) 💄 fix format - [`db19243`](https://github.com/open-webui/open-webui/commit/db1924320566c2a3e11e2e0d66f0de556e3758c4) 💄 fix format - [`0a73aa6`](https://github.com/open-webui/open-webui/commit/0a73aa6667f5e0716d65551d0c64fe81b8e1c6b8) 💄 fix format ### 📊 Changes **50 files changed** (+551 additions, -77 deletions) <details> <summary>View changed files</summary> 📝 `backend/apps/rag/main.py` (+18 -0) 📝 `backend/config.py` (+12 -0) 📝 `src/lib/apis/rag/index.ts` (+2 -0) 📝 `src/lib/components/admin/Settings/Documents.svelte` (+37 -0) 📝 `src/lib/components/chat/Controls/Controls.svelte` (+1 -0) 📝 `src/lib/components/chat/MessageInput.svelte` (+145 -66) 📝 `src/lib/components/chat/Messages/UserMessage.svelte` (+1 -1) 📝 `src/lib/components/common/FileItem.svelte` (+17 -2) 📝 `src/lib/components/workspace/Documents.svelte` (+26 -8) 📝 `src/lib/constants.ts` (+2 -0) 📝 `src/lib/i18n/locales/ar-BH/translation.json` (+11 -0) 📝 `src/lib/i18n/locales/bg-BG/translation.json` (+7 -0) 📝 `src/lib/i18n/locales/bn-BD/translation.json` (+7 -0) 📝 `src/lib/i18n/locales/ca-ES/translation.json` (+8 -0) 📝 `src/lib/i18n/locales/ceb-PH/translation.json` (+7 -0) 📝 `src/lib/i18n/locales/de-DE/translation.json` (+7 -0) 📝 `src/lib/i18n/locales/dg-DG/translation.json` (+7 -0) 📝 `src/lib/i18n/locales/en-GB/translation.json` (+7 -0) 📝 `src/lib/i18n/locales/en-US/translation.json` (+7 -0) 📝 `src/lib/i18n/locales/es-ES/translation.json` (+8 -0) _...and 30 more files_ </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Please verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [x] **Testing:** Have you written and run sufficient tests for validating the changes? - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? # Changelog Entry ### Description #### 1. During the file upload process, initialize the file first, so that the response is faster during the upload process. https://github.com/user-attachments/assets/3fb18878-1453-4920-8cad-4cbda5cb272c #### 2. Environment variables `RAG_MAX_FILE_COUNT` and `RAG_MAX_FILE_SIZE` are also set to limit the maximum size and number of files that users can upload per session, while allowing administrators to freely adjust these values. ![image](https://github.com/user-attachments/assets/dec4df6e-aed8-48cc-a887-4022c66c68c4) #### 3. By adjusting the front end, we can make the front end upload files, display the size of each file, and adapt to previous files, which do not display the size of the file ![image](https://github.com/user-attachments/assets/ef469240-3cd2-45a4-85c7-f369f900f97b) ![image](https://github.com/user-attachments/assets/0b8b539c-8b28-444e-82e6-77284fc41ce9) ##### Warning ![image](https://github.com/user-attachments/assets/d76e001c-8283-4f85-92be-3ed304f6e344) ![image](https://github.com/user-attachments/assets/b10ff1b9-ba68-4710-8400-b94644694105) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 03:29:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#21418