Download a file from an Ajax ( XHR ) call ? #2422
Unanswered
BobSquarePants
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I've changed the following #link.href = window.URL.createObjectURL(req.response)
link.href = window.URL.createObjectURL(req.read() ) but I get now
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to get a file after an Ajax call
in the backend I'm using the function send_from_directory (flask) that sent raw data.
in Bryhton I've tried this
But it's not working...
the line
link.href = window.URL.createObjectURL(req.response)
give the following errorany other way (more Pytonic) to tell the web browser that the incoming ajax return is a file to be downloaded ?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions