当我从打字稿的文件路径中读取文件时。我收到错误消息 - 对象没有成员“statSync”,对象没有成员“createReadStream”。
Below is the code:=
const fs = require('fs');
let filePath:='D:\\Dummy.pdf';
let streamingInput;
if (filePath) {
streamingInput = {
contentLength: fs.statSync(filePath).size,
contentType: contentType,
stream: fs.createReadStream(filePath)
};
return streamingInput;
}