I've a ashx handler which outputs the file, when pinged.
As of now, I have it working by
window.open('url to ping');
I'm happy with the result. But however I'm interested in a better solution, since a user might have turned on popup blocker, which might result in file not downloading. I can also use jquery ( if that helps )
You can simply use
window.location = "http://pathtoyourhandler.ashx"instead.With appropriate
Content-Typethe browser will stay on the current page and begin downloading the requested file.