Using jQuery.filedownload plugin. Some code beautification.