Closed sguidos closed 2 months ago
@sguidos : this is not an issue in PnP Core SDK as we simply return what the SharePoint API returns. Taking a quick peek at the internal SharePoint source I think this will only return a valid URL for the files that can be edited using Office online editors (Word, Excel, PowerPoint,...)
If you want to get a thumbnail it's best to use the respective GetThumnbails method (see https://pnp.github.io/pnpcore/using-the-sdk/files-intro.html#getting-thumbnails-for-a-file) or GetPreview method (https://pnp.github.io/pnpcore/using-the-sdk/files-intro.html#getting-an-embeddable-preview-url).
GetPreview() is exactly what I was looking for, and is working with a wide variety of file types. Thanks!
Category
Describe the bug
The ServerRedirectedEmbedUrl attribute returns a valid URL for files of type .PDF, .DOCX, .DOC, .PPTX, .PPT and .XLSX, but returns an empty string with .XLS (!) and other formats that are viewable in SharePoint by simply clicking on the file in the Documents view (.TXT, .JPG, .PNG, .GIF, etc).
Ironically, the URL returned in the Parent.LinkingUrl is empty for .PDF but valid for .XLS file types.
Steps to reproduce
Expected behavior
A valid ServerRedirectedEmbedUrl and LinkingUrl value is returned for all recognized file types. Any file type that I can "click and preview" in the Documents list should return a valid ServerRedirectedEmbedUrl and LinkingUrl value.
Environment details (development & target environment)
Additional context
I am simply trying to let a user upload a file to our SharePoint Online instance and then Preview what was uploaded in their browser.
Thanks for your contribution! Sharing is caring.