Forum Discussion

e_morling's avatar
e_morling
Copper Contributor
Oct 31, 2020

Integrate & display files in custom app

What is the best way to integrate files within Teams in a custom app? Is there a framework/widget for:

  1. Selecting a file within Team
  2. Display a file within your App (e.g. PPT, PDF, Excel, Word)
  3. Controlling the current slide/page, if you want all users to see the same thing?

Thanks

  • e_morling - Yes you can display the file with in the teams. You can provide the file url to the tab and open the file with in the tab Or to the adaptive card button, but you need to encode the file url please check the below code to encode the URL.

    new AdaptiveOpenUrlAction() {​​ Title = actionText, Url = new Uri(GetFileViewerURL("Your File URL here", "pptx")) }​​;
    private string GetFileViewerURL(string actionData_URL, string prefix)
            {​​
                return $"https://teams.microsoft.com/_#/{​​prefix}​​/viewer/teams/" + actionData_URL?.Replace("/", "~2F");
            }​​

Resources