'dta_export(data, name, type)',
function (data, mime, name, proc) {
mime (which is type in the extension name) and name are swapped! Either make the function match the name or the name match the function (probably the function match the name, as you must set the data or name but you can leave type blank)