Trouble downloading a file with python SDK
I would appreciate some help, It can't be this hard to just be able to download a file. I have the most basic script possible, just trying to download a zip file:
from boxsdk import JWTAuth, Client
config = JWTAuth.from_settings_file(r'C:\Users\me\Desktop\test\498722505_4bso76em_config.json')
client = Client(config)
file_id= "690891438414"
client.file(file_id).content()
This would give me a 404 file not found error. I then found a post saying you need to add the account that is trying to download the file as a collaborator. I found this by running client.user().get()['login'] which gave me AutomationUser_1385795_xbf5Gr4R2I@boxdevedition.com.
Now when I run the above script, it just hangs forever on client.file(file_id).content(), no error messages. What else am I missing?
To clarify, I am able to get info about the file, for example, the following works:
file_info = client.file(file_id).get()
print('File "{0}" has a size of {1} bytes'.format(file_info.name, file_info.size))
Please sign in to leave a comment.
Comments
0 comments