def upload_file(self,local_file,remote_dir,remote_file):
        
        if(not self.is_logged_in()):
            raise(Exception("Can't upload when not logged in"))
            
        self.browser.open('https://www.dropbox.com/')
    
        # Add our file upload to the upload form
        isUploadForm = lambda u: u.action == "https://dl-web.dropbox.com/upload" and u.method == "POST"
    
        try:
            self.browser.select_form(predicate=isUploadForm)
        except:
            raise(Exception('Unable to find upload form'))

        self.browser.form.find_control("dest").readonly = False
        self.browser.form.set_value(remote_dir,"dest")
        self.browser.form.find_control("mtime_utc").readonly = False
        self.browser.form.set_value(str(int(time.time())), "mtime_utc")
        with open(local_file,"rb") as f:
            self.browser.form.add_file(f,"",remote_file)
            self.browser.submit()
Upload a local file to Dropbox
dataset/ETHPy150Open jncraton/PythonDropboxUploader/dbupload/dbconn.py/DropboxConnection.upload_file