From f72eade70721a1c3b0a3ce75abc28d0f7950e66b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 30 Jul 2018 21:52:15 +0100 Subject: [PATCH] box: Fix upload of > 2GB files on 32 bit platforms Before this change the Part structure had an int for the Offset and uploading large files would produce this error json: cannot unmarshal number 2147483648 into Go struct field Part.offset of type int Changing the field to an int64 fixes the problem. --- backend/box/api/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/box/api/types.go b/backend/box/api/types.go index 22e637fe5..e26f05286 100644 --- a/backend/box/api/types.go +++ b/backend/box/api/types.go @@ -172,8 +172,8 @@ type UploadSessionResponse struct { // Part defines the return from upload part call which are passed to commit upload also type Part struct { PartID string `json:"part_id"` - Offset int `json:"offset"` - Size int `json:"size"` + Offset int64 `json:"offset"` + Size int64 `json:"size"` Sha1 string `json:"sha1"` }