Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

s3: fix multipart upload uploading 0 length files

Nick Craig-Wood7242c7ce9582
diff --git a/backend/s3/s3.go b/backend/s3/s3.go
index 4aa3bd8a0..68b78641d 100644
--- a/backend/s3/s3.go
+++ b/backend/s3/s3.go
@@ -2127,7 +2127,7 @@ func (o *Object) uploadMultipart(ctx context.Context, req *s3.PutObjectInput, si
var n int
n, err = readers.ReadFill(in, buf) // this can never return 0, nil
if err == io.EOF {
- if n == 0 {
+ if n == 0 && partNum != 1 { // end if no data and if not first chunk
break
}
finished = true