sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Sharepoint REST download returns incomplete content on aspx files and large files

Open slavag opened this issue 5 years ago • 8 comments

Category

  • [x] Bug

Describe the bug

We're using : /_api/web/GetFileById('<file_guid>')/$value Or /_api/web/GetFileByServerRelativeUrl('')/$value 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

Expected behavior

Returned content length should be exactly the same as in file properties form Sharepoint.

Developer environment

REST API

Thanks

slavag avatar Jan 29 '20 09:01 slavag

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar Jan 29 '20 09:01 msft-github-bot

I can repro this as well...

andrewconnell avatar Jan 29 '20 16:01 andrewconnell

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

slavag avatar Jan 31 '20 06:01 slavag

@andrewconnell Hi, is this repository monitored at all by Microsoft ? Thanks

slavag avatar Feb 05 '20 08:02 slavag

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 avatar Feb 14 '20 21:02 JeremyKelley

@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.

slavag avatar Feb 16 '20 13:02 slavag

Sharepoint team 2 month opened (reproducible) bug here without any care to be taken of. Very sad.

slavag avatar Mar 29 '20 20:03 slavag

I can verify that this bug still persists today in June 2022. Our customers have OneNote files bigger than 15 GB in size (don't ask why). I've tried Sharepoint REST API v1, REST API v2, Graph v1 onenote, copy.asmx webservice, vti_bin author.dll, bytes range in header .... nothing works. So frustating.

antayirp avatar Jun 20 '22 12:06 antayirp