Skip to content

Commit 223696d

Browse files
authored
Merge pull request #156 from gchiam/gchiam/streaming-upload
Thanks!
2 parents dbf9dc4 + ffa7434 commit 223696d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

vmshare/service.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ def post_file(self, rid, filename, filetype, compress=False):
9898
"The upload might fail!\n")
9999
with open(filename, 'rb') as fd:
100100
url = self.get_url('/api/runtime/upload/%s/%s/add' % (filetype, rid))
101-
files = { 'file': fd }
102101
headers = self.get_headers()
103102
headers['Content-Disposition'] = 'attachment; filename='+filename
104103
del headers['Content-Type']
105-
response = requests.post(url, headers=headers, files=files)
104+
response = requests.post(url, headers=headers, data=fd)
106105
self.stop_if_error_occured(response)
107106
return response
108107

0 commit comments

Comments
 (0)