Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readBinary should request an arraybuffer? #3

Open
qlbp opened this issue Nov 30, 2022 · 2 comments
Open

readBinary should request an arraybuffer? #3

qlbp opened this issue Nov 30, 2022 · 2 comments

Comments

@qlbp
Copy link

qlbp commented Nov 30, 2022

Hi there, in Client/src/providers/storageProvider, should the readBinary function request an arraybuffer as the response? I think the axios default is a json, and this causes problems when reading a pdf for example.

    public async readBinary(filename: string, ignoreNotFound?: boolean): Promise<Buffer | undefined> {
        try {
            const api = `${serverUrl}/files/${filename}`;
            const result = await getWithAutoRetry(api, {
                responseType:"arraybuffer" //Added this
            }
        );
            return result.data;
        } catch (exception) {
            this.storageErrorHandler(exception, ignoreNotFound);
        }
    }
@buddhawang
Copy link
Member

Thanks for reporting! Yes we should specify arraybuffer, putting this into our backlog.

@bookmountain
Copy link
Collaborator

Pull request is published to address this issue, please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants