cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

password protected zip fil is not uploaded using files_upload method (Python)

password protected zip fil is not uploaded using files_upload method (Python)

Zarina B.
New member | Level 1

I am trying to upload a zip file using the files_upload method. When I use a regular zip file (not password protected) it works. However, when I use a password-protected zip file the process takes a long time and eventually output the following error:

Traceback (most recent call last):
File "/Users/shifloni/Desktop/walk.py", line 17, in <module>
dp.files_upload(enc, '/encrypted/test.zip')
File "/Users/shifloni/dev/law_venv/lib/python2.7/site-packages/dropbox/base.py", line 377, in files_upload
f)
File "/Users/shifloni/dev/law_venv/lib/python2.7/site-packages/dropbox/dropbox.py", line 175, in request
request_binary)
File "/Users/shifloni/dev/law_venv/lib/python2.7/site-packages/dropbox/dropbox.py", line 256, in request_json_string_with_retry
request_binary)
File "/Users/shifloni/dev/law_venv/lib/python2.7/site-packages/dropbox/dropbox.py", line 316, in request_json_string
verify=True,
File "/Users/shifloni/dev/law_venv/lib/python2.7/site-packages/requests/sessions.py", line 504, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/Users/shifloni/dev/law_venv/lib/python2.7/site-packages/requests/sessions.py", line 461, in request
resp = self.send(prep, **send_kwargs)
File "/Users/shifloni/dev/law_venv/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Users/shifloni/dev/law_venv/lib/python2.7/site-packages/requests/adapters.py", line 415, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))

Has anyone encountered that type of error when uploading password protected zip files using the API?

 

Thanks

4 Replies 4

Greg-DB
Dropbox Staff

The API doesn't pay attention to whether or not a zip file is password protected while uploading it (nor does the file type itself even really matter). It just uploads the raw data as it receives it.

How big is each file though? Is this repeatedly reproducible? 

Zarina B.
New member | Level 1

The file I am able to upload (without a password) is 1.2 MB.

The file I am unable to upload with the password is 186 KB.

The error is repeatedly reproducible. Thanks for your response

Greg-DB
Dropbox Staff

Thanks! Those files are small so size shouldn't be an issue here. It is unexpected that the upload takes a long time though. Might there be anything on your network connection (e.g., firewall or security software) that may be interfering for some reason?

In any case, can you share the sample code and files so we can try to reproduce it? 

Feel free to open a ticket if you'd prefer to share privately:

https://www.dropbox.com/developers/contact

Thanks in advance! 

Zarina B.
New member | Level 1

I actually removed a line from my code that resolved this issue. Thanks for pushing me to look harder 🙂 the issue has something to do with a function I was using to check whether a file is encrypted or not and trying to upload without testing the file first seems to work.

 

Thanks!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Zarina B. New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?