Advertisement
Guest User

Untitled

a guest
Feb 26th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. def uploadFile(uploadFile, folderId):
  2. host = config.get('host')
  3. endpoint = config.get('endpoint')
  4. username=config.get('username')
  5. password=config.get('password')
  6. payload = {"parentID": folderId}
  7. files = {
  8. 'jsonInputParameters': (None,json.dumps(payload)),
  9. 'primaryFile': (os.path.basename(uploadFile), open(uploadFile, 'rb'))
  10. }
  11. requests.post(endpoint, files=files, auth=HTTPBasicAuth(username, password))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement