Is there a way to return a dynamically server-side generated file, which was fetched from a ajax post structure?
Writing a small web mvc project, which generates a list of data(the data is generated from a complex aggregation query and cannot be called from id or whatsoever), and come up to the part on which i want to export some selected parts to a file and download it.
How does it work: 1. On the page i select some fields with key data(using JQuery DataTable) 2. Send it to a controller(Spring to be precise) 3. Generate a bytestream and return it as a HTTPResponse with "Content-disposition", "attachment" header.
Thing is that i select the lines and form the needed data using JQuery->Ajax, so the result of the Controller->Post stays inside the javascript part, not giving me a "Save as...".
I'm already thinking of a temporary directory or something, but saving option for the last.