Skip to content

Instantly share code, notes, and snippets.

@vik-y
Created January 31, 2016 13:55
Show Gist options
  • Save vik-y/adc2ef649e5fb455dc46 to your computer and use it in GitHub Desktop.
Save vik-y/adc2ef649e5fb455dc46 to your computer and use it in GitHub Desktop.
A simple python script to upload files to dropbox
'''
A very simple program to demonstrate how to upload a file on dropbox
Usage: python upload.py filename
'''
import dropbox
import sys
access_token = 'ACCESS_TOKEN_OBTAINED' # Put the access token obtained from previous file here
client = dropbox.client.DropboxClient(access_token)
print 'linked account: ', client.account_info()
f = open(sys.argv[1], 'rb')
response = client.put_file('/test/'+sys.argv[1], f)
print "uploaded:", response
# Feel free to change it as per your requirements.
@arisliang
Copy link

dropbox api v1 doesn't work anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment