Manage Applications

    Upload a part

    put
    https://upload.box.com/api/2.0
    /files/upload_sessions/:upload_session_id

    Updates a chunk of an upload session for a file.

    Request

    application/octet-stream

    Path Parameters

    stringin pathrequired
    D5E3F7A

    The ID of the upload session.

    Request Headers

    stringin headerrequired
    8388608-16777215/445856194

    The byte range of the chunk.

    Must not overlap with the range of a part already uploaded this session.

    stringin headerrequired
    sha=fpRyg5eVQletdZqEKaFlqwBXJzM=

    The RFC3230 message digest of the chunk uploaded.

    Only SHA-1 is supported. The SHA-1 digest must be Base64 encoded. The format of this header is as sha=BASE64_ENCODED_DIGEST.

    Response

    application/jsonUpload Part

    Chunk has been uploaded successfully.

    application/jsonClient Error

    Returns an error if the chunk conflicts with another chunk previously uploaded.

    application/jsonClient Error

    Returns an error if a precondition failed.

    application/jsonClient Error

    Returns an error if the content range does not match a specified range for the session.

    You can now try out some of our APIs live, right here in the documentation.
    Log In

    Request Example

    cURL
    curl -X PUT https://upload.box.com/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Digest: sha=fpRyg5eVQletdZqEKaFlqwBXJzM=" \
         -H "Content-Range: 8388608-16777215/445856194" \
         -H "Content-Type: application/octet-stream" \
         --data-binary @<FILE_NAME>
    Python
    upload_session = client.upload_session('11493C07ED3EABB6E59874D3A1EF3581')
    offset = upload_session.part_size * 3
    total_size = 26000000
    part_bytes = b'abcdefgh'
    part = upload_session.upload_part_bytes(part_bytes, offset, total_size)
    print('Successfully uploaded part ID {0}'.format(part['part_id']))
    Node
    // 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);

    Response Example

    {
      "part_id": "6F2D3486",
      "offset": 16777216,
      "size": 3222784,
      "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
    }