Sharepoint links to none document files in 3rd party app

Ian Foulds 6 Reputation points
2025-02-19T19:07:58.47+00:00

We have an app that links to Sharepoint documents, these can be Word, Excel, images (JPG, PNG, TIF), and PDF files. Most of the links work OK with the exception of TIF files and some other none MS documents.

When viewing TIF files directly in Sharepoint, clicking on TIF files in a folder opens it as an overlay view and displays the file correctly, as it does with other image files and PDFs.

In our 3rd party app we are using the DriveItem WebURL and, for a majority of files, this works and shows the image/document correctly in the browser. However it does not for TIF files and a few others, the WebURL link downloads the file which is not what we want and is contrary to how the file is displayed in Sharepoint.

I can solve the problem by obtaining a 'createLink' for the file, but this seems to be a time expensive process, particularly if there are several TIF files in the folder, and also has the disadvantage of creating a Shared history event for the file. We have hit throttling problems using the 'createLink' method and IMHO is not a long term viable way of doing this.

I have partly mitigated the additional overhead by caching the returned links, however this is a tedious process which I really don't think we should need to do.

If Sharepoint opens the file for viewing, then why does the returned WebURL of the DriveItem not do exactly the same thing?

If there is another way of doing this I would be very grateful to know about it.

Many thanks.

Ian.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,108 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.