diff --git a/Report.pptx b/Report.pptx new file mode 100644 index 0000000..c1cc776 Binary files /dev/null and b/Report.pptx differ diff --git a/flaskr/__init__.py b/flaskr/__init__.py index 8f263a7..4f04fca 100644 --- a/flaskr/__init__.py +++ b/flaskr/__init__.py @@ -26,15 +26,17 @@ def index(): -@app.route('/download') +@app.route('/download', methods=['GET','POST'] ) def download(): - filename_new = f.filename[:f.filename.find('.')] - path = '../'+filename_new + '.pptx' - return send_file(path, as_attachment=True) + if request.method == 'POST': + + filename_new = f.filename[:f.filename.find('.')] + path = '../'+filename_new + '.pptx' + return send_file(path, as_attachment=True) Bootstrap (app) if __name__ == '__main__': # Threaded option to enable multiple instances for multiple user access support - app.run(threaded=True, port=5000) \ No newline at end of file + app.run(threaded=True) \ No newline at end of file diff --git a/flaskr/templates/download.html b/flaskr/templates/download.html index 648e45e..02d569f 100644 --- a/flaskr/templates/download.html +++ b/flaskr/templates/download.html @@ -39,7 +39,7 @@