Skip to content

Instantly share code, notes, and snippets.

@KelviNosse
Last active October 28, 2016 00:12
Show Gist options
  • Save KelviNosse/f8a00d5e47a8d2c076db34e04d0c9d51 to your computer and use it in GitHub Desktop.
Save KelviNosse/f8a00d5e47a8d2c076db34e04d0c9d51 to your computer and use it in GitHub Desktop.
import dropbox
def dbx_upload_file(file_from, file_to, access_token):
"""Funcion para subir un archivo a Dropbox usando API v2
"""
dropb = dropbox.Dropbox(access_token)
with open(file_from, 'rb') as f:
dropb.files_upload(f, file_to)
access_token = 'Token Privado de Acceso'
file_from = "C:\\secret\\dat.txt" # direccion del archivo que se quiere mandar
file_to = '/directorio/dat.txt' # la direccion absoluta en dropbox incluyendo el nombre de archivo
dbx_upload_file(file_from, file_to, access_token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment