You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to fetch file from sharepoint but it is returning corrupted file.
Related to my issue Similar issue raised earlier by me. I was trying to analyse and realised that it worked for txt files but returned corrupted file for .docx type of file.
Expected or Desired Behavior
Calling function should return non corrupted file in buffer
this is correct, docx files are not text files and getText renders the raw textual content of the file. It does not extract text or understand docx or any other format.
We are passing this buffer data to another service where buffer from got works but buffer from this data fails and both buffer returns different length of data.
Major Version
3.x
Minor Version Number
3.19.0
Target environment
NodeJS
Additional environment details
I am trying to fetch file from sharepoint but it is returning corrupted file.
Related to my issue Similar issue raised earlier by me. I was trying to analyse and realised that it worked for txt files but returned corrupted file for .docx type of file.
Expected or Desired Behavior
Calling function should return non corrupted file in buffer
Observed Behavior
I am getting corrupted file for .docx file
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/Test.txt").getBuffer();
Please try below files:-
The text was updated successfully, but these errors were encountered: