Hello Vishal Singh Thapa,
Thank you for posting in Microsoft Q&A Forum.
From your description, I can understand that your React app is integrated as a static tab inside Microsoft Teams, it allows you to download a .docx file which works fine on Teams desktop and web but fails on Team mobile app.
Microsoft Teams mobile apps block or ignore direct file download initiated from embedded web content within custom tabs. The HTLM <a download> attribute and similar mechanisms are not supported inside Teams ' mobile WebView
For your reference:
Here are some workarounds that you can kindly take:
- Upload files to Teams and download from the Files tab:
- Instead of directly downloading from the tab, upload the file into the channel of chat's Files section.
- You can then open Teams > Files > Three dots > Download.
- Open file in system browser:
- Modify your link to open the file in the device's default browser:
<a href="https://yourdomain.com/file.docx" target="_blank" rel="noopener noreferrer">Open in browser</a> - Detect Teams mobile and show alternate UI
- Use Teams JavaScript SDK or user-agent detection:
microsoftTeams.getContext(context => { if (context.hostClientType === 'ios' || context.hostClientType === 'android') { // show "Open in browser" message } });
I hope it helps, please feel free to let me know if you need any further assistance.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.