This Teams Tab enables a user to upload a supported (depending on the target) file type via drag and drop while the uploaded file will be converted as PDF, HTML, JPG depending on user's selection. In Teams context (as configurable Tab) it uses the current Teams' site and the default drive. In case of a personal tab the SharePoint root site's default drive' It uses the following capabilities (mostly) on behalf of Microsoft Graph:
Use HTML5 drag and drop event handling
Teams SSO and O-B-O flow access token generation in backend
Teams Toolkit for Visual Studio
Writing normal files smaller 4MB
Writing files bigger than 4MB with a resumable upload
Retrieving files with format=pdf/html/jpg conversion which is currently supported only with Graph beta endpoint
Use Fluent UI Web Components with Blazor
Hack-together requirements
Used Microsoft Graph .NET SDK 4.54.0 due to blocking issue with TeamsFx and issue with used beta-endpoint)
Used HttpClient with REST for one endpoint due to v1.0 / beta mix and above issue with used beta-endpoint)
Extend sample
Convert from Teams Tab to stand-alone SPA e.g.
Once above issues solved convert to Microsoft Graph .NET SDK >=5.0.0
Extend to GLB conversion (was simply not familiar with that file type(s) and had no samples to test)
Project name
tab-sso-graph-file-conversion
Description
This Teams Tab enables a user to upload a supported (depending on the target) file type via drag and drop while the uploaded file will be converted as PDF, HTML, JPG depending on user's selection. In Teams context (as configurable Tab) it uses the current Teams' site and the default drive. In case of a personal tab the SharePoint root site's default drive' It uses the following capabilities (mostly) on behalf of Microsoft Graph:
Hack-together requirements
Extend sample
Repo URL
https://github.com/mmsharepoint/tab-sso-graph-file-conversion
Team members
mmsharepoint