mlhpdx/s3-upload-stream

Write zero-length files.

Zarepheth opened this issue · 1 comments

Thank you for the example code. Wrapping the AWS SDK S3 Multipart Upload in a stream is quite useful.

However, in my use case, my inputs are compressed files that I must expand and write to S3. Sometimes the compressed file is empty (zero-length), other times it holds files over a gigabyte in size, usually the files are a few megabytes, but the content varies widely.

Can this be easily modified to write zero-length files to S3?

In my own debugging, it looks like the .Net 6 framework is calling the Write method on a separate thread, with only framework code in the call stack. And then, only if there is content to write - I guess a file header with no content doesn't pass the test.

Thanks for opening an issue. I suspect it will be a problem to try to create a zero byte file with the multi-part upload API. I don't recall, but I'll refresh my memory.

Allowing zero length files is certainly something that's possible. It just may be a special case.