Jan 19 2023 02:06 PM
We have documents (Word, Excel, PDF, png, jpg) that were uploaded to a SharePoint Online document library last month using the REST API from an SPFx web part. These documents could be opened in the browser or downloaded from the document library.
Yesterday (1/17) we noticed that all of those documents (regardless of type) now show a file size of 15 bytes. When downloaded and examined, their contents is the following text: [object Object].
This is not happening with documents that were uploaded using the SPO GUI. Those documents have a normal file size and can be opened.
Was there a change to SharePoint online in the last week that would render documents uploaded using REST to be modified/corrupted?
Here are more details on the SPFx web part and REST endpoint that were used:
https://<tenant>.sharepoint.com/_api/web/GetFolderByServerRelativeUrl('FacilityDocuments/Acton')/files/add(url='test.xlsx',overwrite=true)?$expand=ListItemAllFields
const request = {
body: file
};
const response: SPHttpClientResponse = await spHttpClient.post(
endpoint,
SPHttpClient.configurations.v1,
request
);
Feb 15 2023 02:37 PM