diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/AzureBlobBlockUploadStrategy.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/AzureBlobBlockUploadStrategy.java index dc4cb5d6d1..03b57ae50b 100644 --- a/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/AzureBlobBlockUploadStrategy.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/AzureBlobBlockUploadStrategy.java @@ -70,7 +70,7 @@ public class AzureBlobBlockUploadStrategy implements MultipartUploadStrategy { while (offset < length) { blockCount++; long chunkSize = MAX_BLOCK_SIZE; - if (blockCount >= totalBlocks) { + if (length - offset < MAX_BLOCK_SIZE) { chunkSize = length % MAX_BLOCK_SIZE; } bytesWritten += chunkSize;