// IE workaround for "HTML7007: One or more blob URLs were revoked by closing the blob for which they were created. These URLs will no longer resolve as the data backing the URL has been freed."
window.navigator.msSaveBlob(blob,filename);
}else{
varURL=window.URL||window.webkitURL;
vardownloadUrl=URL.createObjectURL(blob);
if(filename){
// use HTML5 a[download] attribute to specify filename