0
hapiを使用してファイルダウンロードAPIを作成します。 res.download()
を使用しないで、reply()
を使用する方法は?hapiを使用してNodeJS Serverからファイルをダウンロード
hapiを使用してファイルダウンロードAPIを作成します。 res.download()
を使用しないで、reply()
を使用する方法は?hapiを使用してNodeJS Serverからファイルをダウンロード
あなたがバッファを作成してから返信
let buf = new Buffer(xls, 'binary');
return reply(buf)
.encoding('binary')
.type('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
.header('content-disposition', `attachment; filename=test-${new Date().toISOString()}.xlsx;`);
のヘッダーとエンコーディングを設定する必要があります