diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py
index 9ed61fbb9..dac65f0cc 100644
--- a/backend/open_webui/config.py
+++ b/backend/open_webui/config.py
@@ -1546,7 +1546,7 @@ ENABLE_FOLDERS = PersistentConfig(
FOLDER_MAX_FILE_COUNT = PersistentConfig(
"FOLDER_MAX_FILE_COUNT",
"folders.max_file_count",
- int(os.environ.get("FOLDER_MAX_FILE_COUNT", "100")),
+ os.environ.get("FOLDER_MAX_FILE_COUNT", ""),
)
ENABLE_CHANNELS = PersistentConfig(
diff --git a/backend/open_webui/routers/auths.py b/backend/open_webui/routers/auths.py
index 34cb41727..fb0c14137 100644
--- a/backend/open_webui/routers/auths.py
+++ b/backend/open_webui/routers/auths.py
@@ -1013,7 +1013,7 @@ class AdminConfig(BaseModel):
ENABLE_COMMUNITY_SHARING: bool
ENABLE_MESSAGE_RATING: bool
ENABLE_FOLDERS: bool
- FOLDER_MAX_FILE_COUNT: int
+ FOLDER_MAX_FILE_COUNT: Optional[int | str] = None
ENABLE_CHANNELS: bool
ENABLE_NOTES: bool
ENABLE_USER_WEBHOOKS: bool
@@ -1040,7 +1040,11 @@ async def update_admin_config(
)
request.app.state.config.ENABLE_FOLDERS = form_data.ENABLE_FOLDERS
- request.app.state.config.FOLDER_MAX_FILE_COUNT = form_data.FOLDER_MAX_FILE_COUNT
+ request.app.state.config.FOLDER_MAX_FILE_COUNT = (
+ int(form_data.FOLDER_MAX_FILE_COUNT)
+ if form_data.FOLDER_MAX_FILE_COUNT
+ else None
+ )
request.app.state.config.ENABLE_CHANNELS = form_data.ENABLE_CHANNELS
request.app.state.config.ENABLE_NOTES = form_data.ENABLE_NOTES
diff --git a/src/lib/components/admin/Settings/General.svelte b/src/lib/components/admin/Settings/General.svelte
index 554951c8d..0b56de20e 100644
--- a/src/lib/components/admin/Settings/General.svelte
+++ b/src/lib/components/admin/Settings/General.svelte
@@ -334,22 +334,22 @@