If you use a windows.location solution, you will get the native solution for downloading files in the browser - which usually is to download the file to the downloads location (if you use attachment=True). I would prefer that than to having to create the file and link to it, or to save it via JS (which is also possible).
Regards, Andréas Den lör 17 nov. 2018 kl 16:55 skrev Joel <j...@eyrie.in>: > Yes. But it's not usable when we're using JavaScript to fetch the url. > > On Sat, 17 Nov, 2018, 9:20 PM Jason <jjohns98...@gmail.com wrote: > >> oh, I didn't know that was a thing. TIL. >> >> >> https://docs.djangoproject.com/en/2.1/ref/request-response/#django.http.FileResponse >> >> note the bit about as_attachment setting content disposition >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/a950f7f3-2e7e-490d-b271-3125829a9376%40googlegroups.com >> <https://groups.google.com/d/msgid/django-users/a950f7f3-2e7e-490d-b271-3125829a9376%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAA%3Diw_8mx5-wsdR39naUt%2BPYiTCGP5dD%2BMCJ8QObB9%2BLGxGqrg%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAA%3Diw_8mx5-wsdR39naUt%2BPYiTCGP5dD%2BMCJ8QObB9%2BLGxGqrg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK4qSCc2kPdm8MFQ6BEBzFxAikKTd2VVsbfKCWeCVgt4bO6a%3Dg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.