hundreds-camera-24900
10/13/2022, 9:31 PMhundreds-camera-24900
10/13/2022, 9:31 PMhundreds-camera-24900
10/13/2022, 9:32 PMwhite-motorcycle-95262
10/13/2022, 9:38 PMhundreds-camera-24900
10/13/2022, 9:39 PMhundreds-camera-24900
10/13/2022, 9:40 PMhundreds-camera-24900
10/13/2022, 9:40 PMwhite-motorcycle-95262
10/13/2022, 9:45 PMhundreds-camera-24900
10/13/2022, 9:45 PMhundreds-camera-24900
10/13/2022, 9:45 PMhundreds-camera-24900
10/13/2022, 9:46 PMwhite-motorcycle-95262
10/13/2022, 9:52 PMbitter-monkey-50309
10/13/2022, 10:17 PMbitter-monkey-50309
10/13/2022, 10:23 PMhundreds-camera-24900
10/13/2022, 10:23 PMbitter-monkey-50309
10/13/2022, 10:26 PMhundreds-camera-24900
10/13/2022, 10:26 PMhundreds-camera-24900
10/13/2022, 10:26 PMwhite-motorcycle-95262
10/13/2022, 11:11 PMboundless-advantage-43563
10/14/2022, 11:18 PMmysterious-toddler-20573
10/14/2022, 11:29 PMmysterious-toddler-20573
10/15/2022, 3:31 PMblue-gold-89534
10/16/2022, 9:25 PMhx-get
?
python
def startDownload(request, pk = None):
file_path = "... path to file ..."
return FileResponse(open(file_path, "rb"), as_attachment = True)
and in the template:
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?gorgeous-airport-54386
10/16/2022, 9:26 PM<a download href="...">
?blue-gold-89534
10/16/2022, 9:27 PMgorgeous-airport-54386
10/16/2022, 9:28 PMblue-gold-89534
10/16/2022, 9:28 PMmysterious-toddler-20573
10/17/2022, 12:07 AMbreezy-minister-64652
10/18/2022, 10:26 AM