Skip to content

Instantly share code, notes, and snippets.

@goldalworming
Last active March 13, 2016 05:31
Show Gist options
  • Save goldalworming/6c4d88ef67a65050ef58 to your computer and use it in GitHub Desktop.
Save goldalworming/6c4d88ef67a65050ef58 to your computer and use it in GitHub Desktop.
def uploadfile(filepath, uploadurl, fileformelementname="upfile"):
'''
This will invoke an upload to the webserver
on the VM
'''
files = {fileformelementname : open(filepath,'rb')}
r = requests.post(uploadurl, files=files)
return r.status_code
uploadStatus = uploadfile(currentFile.fullpath, UPLOADURL, "upfile")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment