It seems that this question is being asked periodically, and the general answer is: "You should not do this with AJAX anyway. Just set the window location to a file."
But I'm trying to request a file that does not actually exist on the server anywhere. It is dynamically generated (according to Django) based on the GET / POST context parameters. The file I want to receive through AJAX and then save it to the client machine is a text file (csv).
Currently, I can get the text on the client machine (and check this by seeing it during registration or notification), but cannot then figure out how to save this text in a file inside the AJAX fn success callback.
Essentially, is it possible, can JS do it? That is, to open the file save dialogs for "files" that are actually AJAX response text?
source
share