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
will work with window.location=
On Saturday, November 17, 2018 at 5:55:18 PM UTC+2, Joel wrote:
>
> Yes. But it's not usable when we're using JavaScript to fetch the url.
>
> On Sat, 17 Nov, 2018, 9:20 PM Jason
> wrote:
>
>> oh, I didn't know that was a thing. TIL.
>>
>>
>>
Yes. But it's not usable when we're using JavaScript to fetch the url.
On Sat, 17 Nov, 2018, 9:20 PM Jason 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
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
Where?
Sincerely yours,
Joel G Mathew
On Sat, 17 Nov 2018 at 20:50, Yavin Aalto Arba wrote:
> did you try to set "as_attachment=True" ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop
did you try to set "as_attachment=True" ?
--
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
not a bad solution, but you could most likely make the link
generator/decoder work in your view handler rather than needing to hit the
database. That would prevent the necessity of some method to clean up the
db of old temp links that are no longer valid.
On Saturday, November 17, 2018 at
Hi Jason,
Thank you for responding.
I solved this by implementing a temporary link system in my model. This
would generate a unique key which points to a foreign key which references
the data I want. When the url with this foreign key is clicked, the pdf is
generated on the fly and presented as a
check out
https://stackoverflow.com/questions/4545311/download-a-file-by-jquery-ajax
--
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
I have a page where several buttons process different functions like
sending a user sms (via API), sends an file by email, or downloads a PDF
file. Button actions dont use forms, but uses ajax requests via javascript.
I used to create a pdf file using javascript (jspdf), but have written code
10 matches
Mail list logo