我的浏览器生成和导入csv文件时遇到问题。根据数据库中包含的数据生成文件。导出工作,但导入时我没有获得数据,但有一些奇怪的迹象。下面我发照片。
答案 0 :(得分:0)
if (typeof FormData == "undefined") {
var file = $("#file");
var objFSO = new ActiveXObject("Scripting.FileSystemObject");
var filePath = file[0].value;
var objFile = objFSO.getFile(filePath);
var iStream = objFSO.OpenTextFile(filePath, 1, false);
var value = iStream.ReadAll();
iStream.Close();
答案 1 :(得分:0)
if (navigator.appName == "Microsoft Internet Explorer") {
var oWin = window.open("about:blank", "_blank");
oWin.document.write('sep=,\r\n' + CSV);
oWin.document.close();
oWin.document.save = "csv";
oWin.document.charset = "UTF-8";
var pathways = oWin.document.execCommand('SaveAs', true, "AuxPt.csv");
oWin.close();