diff --git a/backend/open_webui/routers/files.py b/backend/open_webui/routers/files.py index cf3be4a08a..d9bff0b9e0 100644 --- a/backend/open_webui/routers/files.py +++ b/backend/open_webui/routers/files.py @@ -317,7 +317,9 @@ async def upload_file_handler( # SHA-256 of raw uploaded bytes for incremental sync diffing. # If the client pre-computed and sent file_hash, use that. - file_hash = file_metadata.get('file_hash') or hashlib.sha256(contents).hexdigest() + file_hash = file_metadata.get('file_hash') or await asyncio.to_thread( + lambda: hashlib.sha256(contents).hexdigest() + ) file_item = await Files.insert_new_file( user.id,