Hello everyone,
Currently I'm working in a solution to upload large files to Box, here are my requirements:
- Language = Python (I have to integrate another solution)
- Create a folder there and upload the files
- File size: right now is 7.33 GB
I'm using JWT as authentication method, but I'm struggling using the method Chunked Uploader, can someone please point me in the right direction?
So far, this is what I have
rom boxsdk import JWTAuth
from boxsdk import Client
# Read JSON configuration
auth = JWTAuth.from_settings_file('/FilePath/to/config.json')
# Initialize SDK client
client = Client(auth)
service_account = client.user().get()
print('Service Account user ID is {0}'.format(service_account.id))
# Set upload values
file_path = '/File/Path'
file_name = 'test1.txt'
folder_id = '0'
# Upload the files Chunked
chunked_uploader = client.file(file_name).get_chunked_uploader(file_path)
try:
uploaded_file = chunked_uploader.start()
except:
uploaded_file = chunked_uploader.resume()
print('File "{0}" uploaded to Box with file ID {1}'.format(uploaded_file.name, uploaded_file.id))
