<!doctype html> <title>Hello from Flask</title> {% if filename %} <h1>some text <embed src="{{ url_for('send_file', filename=filename) }}" type="application/pdf">more text!</h1> {% else %} <h1>no image for whatever reason</h1> {% endif %}