microsoft / microsoft/Form-Recognizer-Toolkit

readBinary should request an arraybuffer?

Open
#3 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
96
Forks
61
Avg merge
1h 18m
Merged PRs (30d)
1

Description

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);
        }
    }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Client/src/providers/storageProvider at the readBinary function, then inspect how getWithAutoRetry handles the request response. Confirm that binary file reads use the needed response handling and verify that reading a PDF returns usable data without the reported corruption or parsing problem.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.