onclick
it will call an ajax function. document.location = ..
.Content-Type
header, so the browser will know its an attachment and the download will begin.iframe
and set the URL of the source of that iframe
dynamically. This way you can download the file without refreshing the page.