在我的 Node JS / Express JS 项目中,我需要一个 excel 项目,我将使用这个库read-excel-file。
我需要获取文件路径才能继续使用库文档中的代码:
const readXlsxFile = require('read-excel-file/node');
// File path.
readXlsxFile('/path/to/file').then((rows) => {
// `rows` is an array of rows
// each row being an array of cells.
})
我不了解文件路径,我无法从中获取它,<input type='file' />我只获取文件名。但是文件的位置在客户端设备上而不是在服务器上,所以这个锻炼怎么可能?