diff --git a/app/src/web/log_files.py b/app/src/web/log_files.py index 82fe0c4..fccbd7e 100644 --- a/app/src/web/log_files.py +++ b/app/src/web/log_files.py @@ -50,3 +50,12 @@ async def send(file): directory=Config.get_log_path(), file_name=secure_filename(file), as_attachment=True) + + +@web.route('/del-file/', methods=['DELETE']) +async def delete(file): + try: + os.remove(Config.get_log_path() + secure_filename(file)) + except OSError: + return 'File not found', 404 + return '', 204