FileVersion GetContent Using Invalid URL
See original GitHub issueCategory
- Bug
Describe the bug
Right now, FileVersion
is using $"{PnPContext.Uri}/_layouts/15/download.aspx?SourceUrl={Url}";
, which may work great for a file that is NOT a FileVersion
, but if the URL is _vti_history/512/MyDocLib/wordTest.docx
, you actually get this from SharePoint:
Proposed Resolution
@jansenbe - If you have no issues with it, I’d rather use the OpenBinaryStream function. If you’re good with this, feel free to assign this to me, as I need to get this fixed ASAP for our team.
Side Question
What kind of download size limitations are we going to hit?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
API problem: Get url to specific file version/ content of ...
Summary I'm looking for any way to get content of file from specific commit by Gitlab API (preferable as URL).
Read more >rest - Which status to return for request to invalid URL for ...
Short answer: It does not have to always return 404 . Longer answer: The specification seems to provide some options regarding which status ......
Read more >Error in GPMC when trying to edit registry
Hello,. Getting "an error has occurred in the script on this page" when trying to edit registry on GPMC. Anyone got any ideas?...
Read more >Content Engine error messages
Content Engine error messages. The Content Engine messages include information about problems and warnings that can occur while using Content Engine.
Read more >HistoryVersions:get.content-HistoryVersions-REST-Drive Kit
Downloads a historical version of a file. Scenario. By calling the HistoryVersions.get.content API, your app can download a historical file version.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, that clarifies… Don’t have a specific preference given the “regular” download will not be updated. You might want to test with some larger files, but assume both approaches will work
Well, no. I don’t. PnP.Core still has a bug.
My bug is still accurate. You can’t use
IFileVersion.GetContentAsync()
. If you look atGetFileVersionContentAsyncTest-2-00003.response
, you’ll see that it’s the HTML markup for the Error page in my screenshot above. IOW,download.aspx
does not work for use with the_vti_history
URLs.It seems that the proper use to get these binaries is to either:
IFileVersion.GetContentAsync()
to use the OpenBinaryStream function that is on the RESTIFileVersion
IFileVersion.GetContentAsync()
to literally just do a GET on$"{PnPContext.Uri}/_vti_history/512/MyDocLib/wordTest.docx