-
-
Save evsapi/2697445 to your computer and use it in GitHub Desktop.
IDrive - EVS - REST API - uploadFile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <% | |
| import sys, urllib, urllib2 | |
| from poster.encode import multipart_encode | |
| from poster.streaminghttp import register_openers | |
| from xml.dom.minidom import parseString | |
| import xml.dom.minidom as xdm | |
| register_openers() | |
| uid = "[your user]" | |
| pwd = "[your password]" | |
| # With the URL Upload File | |
| base_url = '[base url from previous get server request]' | |
| url = base_url + '/evs/uploadFile' | |
| localfile = '[path to your local file to upload]' | |
| targetfolder = '[folder you wish to upload on IDrivesync]' | |
| values = {'file':open(localfile), | |
| 'uid':uid, | |
| 'pwd':pwd, | |
| 'p':targetfolder | |
| } | |
| data, headers = multipart_encode(values) | |
| request = urllib2.Request(url, data, headers) | |
| request.unverifiable = True | |
| response = urllib2.urlopen(request) | |
| the_page = response.read() | |
| %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment