def download_report(task_id):
if not task_id.isdigit():
return HTTPError(code=404, output="The specified ID is invalid")
report_path = os.path.join(CUCKOO_ROOT, "storage", "analyses", task_id, "reports", "report.html")
if not os.path.exists(report_path):
return HTTPError(code=404, output="Report not found")
response.content_type = "text/html"
response.set_header("Content-Disposition", "attachment; filename=cuckoo_task_{0}.html".format(task_id))
return open(report_path, "rb").read()
评论列表
文章目录