Skip to content Skip to sidebar Skip to footer

Anchor's Download Property Is Not Working On Some Pages (Gmail)?


Solution 2:

In Chrome with JQuery, I try this approach:

var dataUri = "data:application/csv;charset=utf-8,Col1%2CCol2%2CCol3%0AVal1%2CVal2%2CVal3%0AVal11%2CVal22%2CVal33%0AVal111%2CVal222%2CVal333"
var filename = "somedata.csv"

$("<a download='" + filename + "' href='" + dataUri + "'></a>")[0].click();

I created a temp link and trigger click event on it. but not sure if other browsers work or not.


Post a Comment for "Anchor's Download Property Is Not Working On Some Pages (Gmail)?"