https://htmx.org logo
How would I serve a file with `hx-get`? ```python...
# 🔥-django-htmx
b
How would I serve a file with
hx-get
?
Copy code
python
def startDownload(request, pk = None):
    file_path = "... path to file ..."
    return FileResponse(open(file_path, "rb"), as_attachment = True)
and in the template:
Copy code
html
  <img src="{% static 'images/printer.svg' %}"
       hx-get="{% url 'download' model.pk %}"
       hx-trigger="click">
I can see the png I am trying to load in the webdev console response, but no save dialogue is showing. Is
hx-get
the right choice?