diff --git a/server/frontend/app/classes/save.py b/server/frontend/app/classes/save.py index 52456d7..11b3cd1 100644 --- a/server/frontend/app/classes/save.py +++ b/server/frontend/app/classes/save.py @@ -50,11 +50,13 @@ class Save(): if method == "usb": cd = datetime.now().strftime("%d%m%Y-%H%M") if shutil.make_archive("{}/TinyCheck_{}".format(self.mount_point, cd), "zip", "/tmp/{}/".format(token)): + shutil.rmtree("/tmp/{}/".format(token)) return jsonify({"status": True, "message": "Capture saved on the USB key"}) elif method == "url": cd = datetime.now().strftime("%d%m%Y-%H%M") if shutil.make_archive("/tmp/TinyCheck_{}".format(cd), "zip", "/tmp/{}/".format(token)): + shutil.rmtree("/tmp/{}/".format(token)) with open("/tmp/TinyCheck_{}.zip".format(cd), "rb") as f: return send_file( io.BytesIO(f.read()),