Forum Discussion
e_morling
Oct 31, 2020Copper Contributor
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: Selecting a file within Team Display a file within your App (e.g. PPT, PDF, Excel, Word) Con...
Nikitha-MSFT
Microsoft
Nov 02, 2020e_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");
}
e_morling
Nov 03, 2020Copper Contributor
Nikitha-MSFT Thank you, do you have an example with Javascript?
- Nikitha-MSFTNov 04, 2020
Microsoft
e_morling - Currently we don't have example in javascript
- e_morlingNov 04, 2020Copper Contributor
Nikitha-MSFT But it is possible to do in Javascript? With the example you provided in Java, is the file "on top" of the application? So that once the user closes the file the app is still open behind it?
- Nikitha-MSFTNov 05, 2020
Microsoft
e_morling - The code which I provided for the file not application. When you close it will close the file not application. It is by design.