on 2024 Sep 30 7:32 AM
Hello, I am trying this feature in order to download a dynamically generated excel from a UI5 app: https://cap.cloud.sap/docs/node.js/best-practices#custom-streaming-beta
The way this:
const readable = Readable.from(buffer)
return {
value: readable,
$mediaContentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
$mediaContentDispositionFilename: `${fileName}.xlsx`,
}
Where readable is of type stream.Readable and the buffer comes from ExcelJS.
When I trigger it in the browser, it correctly downloads an attachment of type XLSX, but the content is:
{
@odata.context: "$metadata#Edm.Binary"
value: {
value: "[object Readable]"
$mediaContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
$mediaContentDispositionFilename: "DCT - 212 - TEST TAX - SSD 2024-10-05.xlsx"
}
}
So somehow, the readable stream it not used correctly down the line. Am I doing something wrong?
Request clarification before answering.
User | Count |
---|---|
33 | |
21 | |
16 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.