【发布时间】:2021-01-19 21:27:46
【问题描述】:
我需要将生成的 PDF 作为 whatsapp 消息发送,但是当我尝试读取我的文件时它显示错误。
easyinvoice.createInvoice(data, function(result) {
//The response will contain a base64 encoded PDF file
fs.writeFileSync("invoice.pdf", result.pdf, 'base64');
var s = result.pdf;
client.messages
.create({
mediaUrl: s,
body: 'invoice',
from: 'whatsapp:+somenumber',
to: 'whatsapp:+somenumber'
})
.then(message => console.log(message.sid))
.done();
});
【问题讨论】:
-
那么,错误是什么?
标签: javascript node.js express twilio twilio-api