We're using :
/_api/web/GetFileById('
Or
/_api/web/GetFileByServerRelativeUrl('
We see that on many aspx files and on large files, the content that is returned is incomplete.
In the files properties I see one size and when entire stream is read. We see it constantly in Site Pages aspx files, and from time to time on large files. Network issues are eliminated. Some other people are also complaining about this issue :
https://stackoverflow.com/questions/59737754/sharepoint-rest-api-returns-incomplete-content-of-file-during-downloading
Returned content length should be exactly the same as in file properties form Sharepoint.
REST API
Thanks
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
I can repro this as well...
Microsoft guys, any update on this?
This issues is causing to data corruption on migration and backup processes, one of major sharepoint api is buggy. Please take a care
@andrewconnell Hi, is this repository monitored at all by Microsoft ? Thanks
I asked around internally and the guidance I got was to use the Microsoft Graph endpoint or the "download.aspx" URL which supports byte range requests for reliable downloads instead of the /$value.
That said, for site pages, are you expecting to back them up by backing up the *.aspx file? If that's the target scenario you will likely run into issues. We don't currently have an officially supported way of working with site pages using the APIs today.
@JeremyKelley Thanks for the feedback. Few points :
1) Graph API doesn't supports downloading attachments from the list items. Also Graph API as far as I know doesn't returns all lists and document libraries when enumerating drives (this is the way to work with document library).
2) As part of backup that we provides to our customers we need to backup also aspx files and currently it's an issue.
3) In many cases I see downloaded size much larger than size in metadata on PDF, Doc and not only in aspx. How can I use Graph API when I don't know what is real file size ? As metadata size doesn't match real file size ? if It's download less, I can try to ask for additional bytes using Graph API, but when downloaded more ?? Sio bug is not only in download API but also in metadata (as size property is not valid).
4) REST API is officially supported API, why not fixing bugs there ? I can understand that for deprecated API but as far as I know it's not deprecated yet. And it's a bug !!! And as I said this bug is not only for aspx files, but it's not consistent. Graph API has many limitations for very long period and it's doesn't seems progressing.
So, bottom line REST API is buggy and nobody is fixing those bugs, and Graph API is very limited and can't be used.
Sharepoint team 2 month opened (reproducible) bug here without any care to be taken of. Very sad.
Most helpful comment
Sharepoint team 2 month opened (reproducible) bug here without any care to be taken of. Very sad.