Deleting saved capture folder
This commit is contained in:
parent
534f847ea7
commit
a6c88b7cea
@ -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()),
|
||||
|
Loading…
Reference in New Issue
Block a user