From 839ba9eed0083c318308743e0d40aae33a40e91b Mon Sep 17 00:00:00 2001 From: Amit Raut <12902959+amit-raut@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:40:01 -0400 Subject: [PATCH] attachment_filename is replaced with download_name for Flask's send_file method Updated code for successful downloading of the PCAP file. Currently the code is based on the deprecated method parameter `attachment_filename`. `attachment_filename` is replaced with `download_name` in Flask's send_file method (Please see https://github.com/pallets/flask/issues/4753 for more details). Thanks, Amit Raut --- Re2Pcap/Re2Pcap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Re2Pcap/Re2Pcap.py b/Re2Pcap/Re2Pcap.py index 27233a3..125fb97 100755 --- a/Re2Pcap/Re2Pcap.py +++ b/Re2Pcap/Re2Pcap.py @@ -133,7 +133,7 @@ def createPcap(): time.sleep(5) childProc.communicate() if not childProc.returncode: - return send_file('io/Re2Pcap-result.pcap', as_attachment=True, attachment_filename=resultFileName) + return send_file('io/Re2Pcap-result.pcap', as_attachment=True, download_name=resultFileName) else: return jsonify(error='Something went Wrong :( Please Check the Input/ Error log and Try Again ....') else: