Creates an upload session for an existing file.
12345
The unique identifier that represent a file.
The ID for any file can be determined
by visiting a file in the web application
and copying the ID from the URL. For example,
for the URL https://*.app.box.com/files/123
the file_id
is 123
.
Project.mov
The optional new name of new file
104857600
The total number of bytes of the file to be uploaded
Returns a new upload session.
Returns an error if the file already exists, or the account has run out of disk space.
An unexpected client error.
curl -X POST https://upload.box.com/api/2.0/files/12345/upload_sessions \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
-H 'Content-Type: application/json" '
-d '{
"file_size": 104857600
}'
file_size = 26000000
upload_session = client.file('11111').create_upload_session(file_size)
print('Created upload session {0} with chunk size of {1} bytes'.format(upload_session.id, upload_session.part_size))