|
@@ -10,9 +10,17 @@ class orthancFileBrowser:
|
|
def getZip(self,retrieveLevel, dataId, path):
|
|
def getZip(self,retrieveLevel, dataId, path):
|
|
url=self.net.getCoreURL()
|
|
url=self.net.getCoreURL()
|
|
url+="/"+retrieveLevel+"/"+dataId+"/archive";
|
|
url+="/"+retrieveLevel+"/"+dataId+"/archive";
|
|
|
|
+ print("Using: {}".format(url))
|
|
response=self.net.get(url,binary=True);
|
|
response=self.net.get(url,binary=True);
|
|
with open(path,'wb') as out_file:
|
|
with open(path,'wb') as out_file:
|
|
shutil.copyfileobj(response,out_file)
|
|
shutil.copyfileobj(response,out_file)
|
|
response.release_conn()
|
|
response.release_conn()
|
|
#response.data is a byte array -> is the same as file
|
|
#response.data is a byte array -> is the same as file
|
|
|
|
|
|
|
|
+ def upload(self,path):
|
|
|
|
+ url=self.net.getCoreURL()
|
|
|
|
+ url+="/instances"
|
|
|
|
+ with open(path,'rb') as f:
|
|
|
|
+ response=self.net.post(url,"octet-stream", f.read())
|
|
|
|
+ print(response.data)
|
|
|
|
+
|