As we know you cannot create a file download via ajax.
you can however submit a form which will create a download prompt.
I am generating quite a big file when the users presses a button so I display a “please wait” style message.
My question is,
How can I detect when the form submission has finished, hence the dialog box has been shown?
(this is to hide the message)
Maybe you should try something like this
http://www.iamkumaran.com/xdownloader-a-flash-javascript-library/
See the demo how file download works and I hope it may help you.