How do you upload a directory to S3? #107
-
When attempting to upload a
This is using the sample code https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/examples/s3-helloworld/src/main.rs modified for a directory let body = ByteStream::from_path(Path::new("src/")).await?;
let resp = client
.put_object()
.bucket(BUCKET)
.key(KEY)
.body(body)
.send(); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
ByteStream::from_path
only works from files. The SDK doesn't currently provide any direct utilities to upload directories—you'd need to iterate over the files and upload them individually.