From 7535bac9e47d9476110e7d6b48cfb5fc759297ee Mon Sep 17 00:00:00 2001 From: Wei Xu Date: Thu, 7 Nov 2024 17:48:45 +1100 Subject: [PATCH] Use download_file instead of download_fileobj to solve the 0 size issue --- backend/open_webui/storage/s3_storage_provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/storage/s3_storage_provider.py b/backend/open_webui/storage/s3_storage_provider.py index 344de98ab..19962283b 100644 --- a/backend/open_webui/storage/s3_storage_provider.py +++ b/backend/open_webui/storage/s3_storage_provider.py @@ -57,7 +57,7 @@ class S3StorageProvider(StorageProvider): try: bucket_name, key = file_path.split("//")[1].split("/", 1) with NamedTemporaryFile() as f: - self.client.download_fileobj(bucket_name, key, f) + self.client.download_file(bucket_name, key, f.name) yield f.name except Exception as e: raise RuntimeError(f"Error downloading file {file_path} from S3: {e}")