mirror of
https://github.com/open-webui/open-webui
synced 2024-11-22 08:07:55 +00:00
Use download_file instead of download_fileobj to solve the 0 size issue
This commit is contained in:
parent
014d4873c8
commit
7535bac9e4
@ -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}")
|
||||
|
Loading…
Reference in New Issue
Block a user