Skip to content

Commit 4d39ed4

Browse files
authored
fix(upload-client/multipart): set custom chunk size when starting multipart upload
If a multipart upload is started with a custom part size, the part size must be set in the request to `/multipart/start/` via `part_size`. Otherwise, the default 5 MB part size is used, which causes the subsequent request to `/multipart/complete/` to fail with the following error: ``` { "error": { "status_code": 400, "content": "Can not complete upload. Wrong parts size?", "error_code": "MultipartFileCompletionFailedError" } } ```
1 parent 89191cd commit 4d39ed4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/upload-client/src/uploadFile/uploadMultipart.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ export const uploadMultipart = async (
143143
userAgent,
144144
retryThrottledRequestMaxTimes,
145145
retryNetworkErrorMaxTimes,
146-
metadata
146+
metadata,
147+
multipartChunkSize
147148
})
148149
.then(async ({ uuid, parts }) => {
149150
const getChunk = await prepareChunks(file, size, multipartChunkSize)

0 commit comments

Comments
 (0)