javascript提取标签二进制文件

/**
 * @param fileTarget [dom object]
 */
function openFile(fileTarget) {
    let file = fileTarget.files[0];
    var blob = new Blob([file], {type: file.type + ";charset=utf-8"}),
        Temp = document.createElement("a");
    Temp.href = window.URL.createObjectURL(blob);
    Temp.download = file.name;
    $('body').append(Temp);
    Temp.click();
}

你可能感兴趣的:(javascript提取标签二进制文件)