I'm trying to use the files_upload (through the Pythoon api) but I'm getting an error if the file is somewhat larger, but less than 20MB.
The documentation states that files_upload shouldn't be used for files larger than 150MB, which will be true for the files I'm trying to upload.
I tried to use files_upload_session_start, but the problem perrsists.
This is the error I get when trying to upload a 13,3MB file:
Traceback (most recent call last):
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 357, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 1065, in _send_output
self.send(chunk)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 986, in send
self.sock.sendall(data)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 972, in sendall
v = self.send(byte_view[count:])
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 941, in send
return self._sslobj.write(data)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 642, in write
return self._sslobj.write(data)
socket.timeout: The write operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\util\retry.py", line 357, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\packages\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 357, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 1065, in _send_output
self.send(chunk)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\http\client.py", line 986, in send
self.sock.sendall(data)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 972, in sendall
v = self.send(byte_view[count:])
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 941, in send
return self._sslobj.write(data)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 642, in write
return self._sslobj.write(data)
urllib3.exceptions.ProtocolError: ('Connection aborted.', timeout('The write operation timed out',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".\dropboxapi.py", line 37, in <module>
uploader.uploadandDelete()
File ".\dropboxapi.py", line 29, in uploadandDelete
self.box.files_upload(f.read(), '/Sandbox/' + item, mute = True)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dropbox\base.py", line 2207, in files_upload
f,
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dropbox\dropbox.py", line 272, in request
timeout=timeout)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dropbox\dropbox.py", line 363, in request_json_string_with_retry
timeout=timeout)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dropbox\dropbox.py", line 447, in request_json_string
timeout=timeout,
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 555, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\adapters.py", line 490, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', timeout('The write operation timed out',))