client.getChunkedUploads().uploadFilePart(acc.getUploadSessionId(), generateByteStreamFromBuffer(chunkBuffer), new UploadFilePartHeaders(digest, contentRange))
//Reading a large fileFileInputStream fis = new FileInputStream("My_Large_File.txt");//Create the digest input stream to calculate the digest for the whole file.DigestInputStream dis = new DigestInputStream(fis, digest);List<BoxFileUploadSessionPart> parts = new ArrayList<BoxFileUploadSessionPart>();//Get the part size. Each uploaded part should match the part size returned as part of the upload session.//The last part of the file can be less than part size if the remaining bytes of the last part is less than//the given part sizelong partSize = sessionInfo.getPartSize();//Start byte of the partlong offset = 0;//Overall of bytes processed so farlong processed = 0;while (processed < fileSize) { long diff = fileSize - processed; //The size last part of the file can be less than the part size. if (diff < partSize) { partSize = diff; } //Upload a part. It can be uploaded asynchorously BoxFileUploadSessionPart part = session.uploadPart(dis, offset, (int)partSize, fileSize); parts.add(part); //Increase the offset and proceesed bytes to calculate the Content-Range header. processed += partSize; offset += partSize;}
upload_session = client.upload_session('11493C07ED3EABB6E59874D3A1EF3581')offset = upload_session.part_size * 3total_size = 26000000part_bytes = b'abcdefgh'part = upload_session.upload_part_bytes(part_bytes, offset, total_size)print(f'Successfully uploaded part ID {part["part_id"]}')
// Upload the part starting at byte offset 8388608 to upload session '93D9A837B45F' with part ID 'feedbeef'client.files.uploadPart('93D9A837B45F', part, 8388608, 2147483648, {part_id: 'feedbeef'}, callback);