Closed kaushalbcactus closed 5 months ago
We just call the response object's method. It might be an issue in node-fetch, have you checked their issue list for anything similar?
Note the file in your request that you posted is not the same file that you shared...
Closing this due to inactivity. If you continue to have issues please open a new issue, link to this issue, and provide any additional details available. Thanks!
This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.
Major Version
3.x
Minor Version Number
3.24.0
Target environment
NodeJS
Additional environment details
I am using node js and certificate based authentication. I am trying to fetch file but returned array buffer is corrupted. When I perform same operation with GOT then it works perfectly
Expected or Desired Behavior
Return correct buffer or arraybuffer which can be converted to buffer
Observed Behavior
Returned incorrect or corrupted arraybuffer
Steps to Reproduce
import { spfi } from "@pnp/sp"; import "@pnp/sp/webs"; import "@pnp/sp/files"; import "@pnp/sp/folders";
const sp = spfi(...);
const buffer: ArrayBuffer = await sp.web.getFileByServerRelativePath("/sites/dev/documents/file.avi").getBuffer();
Please check "Uint8Array" - PNPjs gives around 31070 While got gives 19316.![image](https://github.com/pnp/pnpjs/assets/49706885/8348014c-c2eb-478e-bdce-55defc97eaf1)
Whereas working with got command (https://www.npmjs.com/package/got)
Kindly provide help on this issue as I have implemented pnpjs on all my other functions and now stuck with this.
Please let me know if any other details needed. Thanks!