microsoft / microsoft/Form-Recognizer-Toolkit
readBinary should request an arraybuffer?
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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