From d594602e18d6c372837ddc8e617195ea0b499bd5 Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Fri, 7 Jun 2024 21:01:55 +0530 Subject: [PATCH] saving data to zip --- src/py/bbctrl/Web.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/py/bbctrl/Web.py b/src/py/bbctrl/Web.py index 735ee22..9abef74 100644 --- a/src/py/bbctrl/Web.py +++ b/src/py/bbctrl/Web.py @@ -306,11 +306,11 @@ class ConfigRestoreHandler(bbctrl.APIHandler): files_path = os.path.join(temp_dir, zip_file['filename']) - # try: - # with open(files_path, 'wb') as f: - # f.write(zip_file['body']) - # except Exception as e: - # raise HTTPError(500, f"Error handling zip file: {str(e)}") + try: + with open(files_path, 'wb') as f: + f.write(zip_file['body']) + except Exception as e: + raise HTTPError(500, f"Error handling zip file: {str(e)}") # if not os.path.exists(self.get_upload()): # os.mkdir(self.get_upload())