The single-shot upload path sent the source straight to Box as a multipart body with no Content-Length, so a source that supplied fewer bytes than its declared size produced a short request that Box accepted and stored, and the upload was reported as a success. Count the bytes actually read and fail the upload if they do not match the declared size. The multipart path already reads each chunk with io.ReadFull and so already fails in this case.