From 41cd60a0f3dc2c1320f5115c6447457d74544200 Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Fri, 7 Jun 2024 14:35:40 +0530 Subject: [PATCH] os path --- src/py/bbctrl/Web.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/py/bbctrl/Web.py b/src/py/bbctrl/Web.py index 1ed659d..1ca86f6 100644 --- a/src/py/bbctrl/Web.py +++ b/src/py/bbctrl/Web.py @@ -294,7 +294,7 @@ class ConfigDownloadHandler(bbctrl.APIHandler): self.finish() class ConfigRestoreHandler(bbctrl.APIHandler): - def put(self): + def put_ok(self): if 'zipfile' not in self.request.files: raise HTTPError(401,'No file uploaded') @@ -308,9 +308,10 @@ class ConfigRestoreHandler(bbctrl.APIHandler): fmt = socket.gethostname() + '-%Y%m%d.zip' filename = datetime.date.today().strftime(fmt) + file_path = os.path.join(temp_dir, filename) try: - with open(temp_dir+filename,'wb') as f: + with open(file_path, 'wb') as f: f.write(zip_file['body']) except Exception as e: