Closed DanTm99 closed 4 months ago
@DanTm99 : PnP Core SDK is a wrapper on top of various Microsoft SharePoint/Teams APIs. In case of preview we use the Graph preview API (https://learn.microsoft.com/en-us/graph/api/driveitem-preview?view=graph-rest-1.0), however this API is not available for a file version (https://learn.microsoft.com/en-us/graph/api/resources/driveitemversion?view=graph-rest-1.0). The same applies to the REST/CSOM APIs (https://s-kainet.github.io/sp-rest-explorer/#/entity/SP.FileVersion).
Given there's no API that can offer this feature we can't implement here. The only possible way I see if you restore an older version as current version, grab the preview and store that somewhere and then set the previous version back as current. This behavior however is not something we should include in the SDK as it temporarily overwrites data just to get a preview.
Hope you understand, but I have to close this one.
Category
Describe the feature
Get a file preview url for a given file version, to be used in an iframe. Similar to
GetUrl
from theIFilePreview
returned byIFile.GetPreview()
andIFile.GetPreviewAsync()
.Describe the solution you'd like
Add
IFileVersion.GetPreview()
andIFileVersion.GetPreviewAsync()
that returnIFilePreview
andTask<IFilePreview>
respectively.Additional context