Hi,
I have a custom actions which reading my database and converts the json response to an excel file.
Once the action is complete I want to send a SSE to my client browser with the buffer file as the payload.
What I am doing:
$.send.sse({
channel: this.channelId,
payload: buffer,
});
The buffer payload looks like this when I log it:
Is there a way to pass a header to the SSE with a content-type notifying the payload being an excel file for example?
Just like you would do with a node.js response:
var wbbuf = XLSX.write(wb, { type: 'buffer' });
res.writeHead(200, [['Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']]);
res.end( wbbuf );