Vengeance
Vengeance7mo ago

Send File Back From Procedure

Is there a way to send content like this back from a tRPC procedure?
const headers = {
"Content-Type": "application/vnd.apple.pkpass",
"Content-Disposition": `attachment; filename=${passFilename}`,
"Content-Length": passBuffer.length.toString(),
};

return new Response(passBuffer, { headers });
const headers = {
"Content-Type": "application/vnd.apple.pkpass",
"Content-Disposition": `attachment; filename=${passFilename}`,
"Content-Length": passBuffer.length.toString(),
};

return new Response(passBuffer, { headers });
1 Reply
Mika
Mika7mo ago
No, you cannot do that using tRPC.. Use regular API endpoints for that

Did you find this page helpful?