Adding bytes using the Amazon S3.Net SDK

I have the following code snippet that works great for simple file uploads. But let me say that I wanted to add to an existing file, or just load random pieces of bytes, such as the first and last 10 bytes? Is this possible with the official SDK?

PutObjectRequest request = new PutObjectRequest();

FileStream fs = new FileStream(@"C:\myFolder\MyFile.bin", FileMode.Open);
request.WithInputStream(fs);
request.WithBucketName(bucketName);
request.WithKey(keyName);
client.PutObject(request);
fs.Close();
+3
source share
2 answers

Cannot add data to existing objects in S3. You must overwrite the entire file.

Although, by saying this, you can get a degree of support for Amazon large file . With this download, they are broken into pieces and assembled on S3. But you must do this as part of a single transfer and only for large files.

+4
source

All Articles