I have an ASPX form page that works synchronously (no AJAX!).
One of the buttons on this page returns a file to be downloaded by writing it directly into response stream:
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=logfile.txt");
Response.TransmitFile(Server.MapPath("~/wmtest.docx"));
Response.End();
I need a javascript callback to be called on the page when response is returned, just before or after browser displays the "download file" dialog.
Is there any way to do that?
Note: It's not real phisical file existing on the server that can be accessed or downloaded by URL, but a file that is generated and returned within request, so returning file's URL and then making it to be downloaded with JS on the client side is not an option
Thanks in advance! - Michael