【发布时间】:2015-09-04 10:11:08
【问题描述】:
我正在尝试使用 xls-to-json 节点模块将 xls 文件读取为 json 格式
发送文件路径时显示错误,例如路径必须是字符串
我在sn-p下面使用
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返回什么?