Skip to content

Fix multipart uploads not working

Stan Hu requested to merge sh-fix-multipart-large-uploads into gitlab/master

Previously when the body size exceeded SINGLE_BLOB_PUT_THRESHOLD (33554432 bytes), the gem used the Put Block API (https://docs.microsoft.com/en-us/rest/api/storageservices/put-block) to upload the file in multiple blocks. The API (https://docs.microsoft.com/en-us/rest/api/storageservices/put-block) says that Content-Length is required as of 2020-12-12.

We fix this by using a key feature mentioned in https://github.com/Azure/azure-storage-ruby/blob/master/blob/ChangeLog.md in the client library:

  • Added the support for Azure::Storage::Blob::BlobService::create_block_blob to handle large payload that used to require making multiple Azure::Storage::Blob::BlobService::put_blob_block calls and calling Azure::Storage::Blob::BlobService::commit_blob_blocks.

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/259838
Edited by Stan Hu

Merge request reports