2017-02-17 40 views

回答

1

你需要做一个缓冲区,然后设置的答复

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;`); 
头和编码