I have a very similar requirement specified here.
I need to have the user\'s browser start a download manually when $(\'a#someID\').click();
But
I'm surprised not a lot of people know about the download attribute for a elements. Please help spread the word about it! You can have a hidden html link, and fake a click on it. If the html link has the download attribute it downloads the file, not views it, no matter what. Here's the code. It will download a cat picture if it can find it.
Note: This is not supported on all browsers: http://www.w3schools.com/tags/att_a_download.asp