There was an error while loading. Please reload this page.
2 parents dbf9dc4 + ffa7434 commit 223696dCopy full SHA for 223696d
1 file changed
vmshare/service.py
@@ -98,11 +98,10 @@ def post_file(self, rid, filename, filetype, compress=False):
98
"The upload might fail!\n")
99
with open(filename, 'rb') as fd:
100
url = self.get_url('/api/runtime/upload/%s/%s/add' % (filetype, rid))
101
- files = { 'file': fd }
102
headers = self.get_headers()
103
headers['Content-Disposition'] = 'attachment; filename='+filename
104
del headers['Content-Type']
105
- response = requests.post(url, headers=headers, files=files)
+ response = requests.post(url, headers=headers, data=fd)
106
self.stop_if_error_occured(response)
107
return response
108
0 commit comments