0
我试图用xls-to-json
节点模块 读取XLS文件,以JSON格式的字符串,而发送的文件路径它表明类似路径的错误必须是一个字符串帆:类型错误:路径必须是
我中号使用下面的代码片段
var fs = uploadedFiles[0].fd;
//fs is a file path
node_xj = require("xls-to-json");
node_xj({
input:fs,
}, function(err, result)
{
if(err)
{
console.error(err);
}
else
{
console.log(result);
}
});
错误
fs.js:430
binding.open(pathModule._makeLong(path),
^
TypeError: path must be a string
请帮助解决这个问题。
这是什么'的typeof UPLOADEDFILES [0] .fd'返回? –
它返回字符串。 – Martin