diff --git a/flask_app/app/main/routes.py b/flask_app/app/main/routes.py index c36c90c..9e38594 100644 --- a/flask_app/app/main/routes.py +++ b/flask_app/app/main/routes.py @@ -311,7 +311,10 @@ def download_upload(i_upload:int = 0, bl_download:bool = True): o_out = io.BytesIO(o_upload.b_file) s_mimetype = o_upload.v_mime_type s_filename = o_upload.v_filename - resp = send_file(o_out, mimetype=s_mimetype, as_attachment=bl_download, download_name=s_filename) + # resp = send_file(o_out, mimetype=s_mimetype, as_attachment=bl_download, download_name=s_filename) + resp = make_response(o_out) + resp.headers.set("Content-Disposition", f"attachment; filename=\"{s_filename}\"" if bl_download else "inline") + resp.headers.set("Content-Type", s_mimetype) return resp else: return make_response("No upload retrieved", 500) @@ -776,6 +779,14 @@ def user_details(i_user_id:int = 0): # end of user_details view function for route /user_details//   +@bp.route("/css_sample", methods=["GET"]) +def css_sample(): + """CSS sample page - purely testing""" + s_base = "base_bs.html" if Config.BOOTSTRAP else "base.html" + s_url = url_for("main.index")#, _external=True) + return render_template("css_sample.html", js=True, base=s_base, url=s_url) +# end of css_sample view function for route /css_sample +  s_todo = """ double-check both try-except across the board, along with then logging exceptions diff --git a/flask_app/app/templates/index.html b/flask_app/app/templates/index.html index 211713f..68aa33e 100644 --- a/flask_app/app/templates/index.html +++ b/flask_app/app/templates/index.html @@ -296,8 +296,9 @@ try { $.each(o_data.uploads, function(ix, u) { s_html = s_html + "
  • \n";