Skip to content

API returns invalid PDF #85

@thomasjetzinger

Description

@thomasjetzinger

Hi!

I have an endpoint which should allow the user to fetch a PDF, which is returned as bytearray, from an internal reporting server. This PDF should then be returned to the client:

`const pdfAsByteArray = await reportService.generateReportAndWait(user.user, reportParameters);

return this.response.header('Content-Type', 'application/pdf').sendFile(pdfAsByteArray);`

I've also add the media type "appication/pdf" to the "Binary meda types" section in the API Settings of my REST api.
From my understanding the byte array should be converted to base64 and then automatically be converted back to binary in the client.

But the on client the response is still in base64 format!

What I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions