I am aware that this error means "Cannot find file," howevever, I have this code copy and pasted, with an almost identical file scheme, and it works in one project and not the other.
The code I have is as follows...
var req = request.post({encoding: null, url: 'https://pdftables.com/api?key=770oukvvx1wl&format=xlsx-single'}, function (err, resp, body) {
if (!err && resp.statusCode == 200) {
fs.writeFile("output.xlsx", body, function(err) {
if (err) {
console.log('error writing file');
}
});
} else {
console.log('error retrieving URL');
console.log(err)
console.log(resp.statusCode)
};
});
var form = req.form();
form.append('file', fs.createReadStream('./TOM_Sample_ScoreCard.pdf'));