mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Stream a local file to S3 with managed multipart upload 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
79c8890d07
commit
879581bb32
1 changed files with 2 additions and 1 deletions
|
|
@ -25,7 +25,8 @@ class S3Client:
|
|||
"""Upload a file from local disk, using boto's managed transfer so a
|
||||
large object (a multi-GB Download Package ZIP, ADR-0060) is streamed in
|
||||
multipart from ``/tmp`` rather than held in memory."""
|
||||
raise NotImplementedError
|
||||
self._client.upload_file(Filename=local_path, Bucket=self._bucket, Key=key)
|
||||
return f"s3://{self._bucket}/{key}"
|
||||
|
||||
def generate_presigned_url(self, key: str, expires_in: int) -> str:
|
||||
"""A time-limited URL that lets the holder GET this object without AWS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue