Share an HTML file in Teams and have it open as a page
Quick answer
An HTML file posted in Microsoft Teams stays a file, routed to the team's SharePoint folder in channels or to your OneDrive for Business in chats. Microsoft's SharePoint docs state that SharePoint Online does not run an HTML file with embedded script in the browser, showing it as raw content or downloading it instead. That strict handling is the default, and a tenant cannot switch it off. Publish the file and post its link so everyone sees the same working page. On the Convika Free plan, the link opens in any browser with no account needed for a colleague or a student in a class team. The upload box on this page gives a preview link that works for 3 minutes with scripts off, so post the published address rather than that link.
Free plan: no credit card, 1 published page, scripts run on every page.
On this page
Copilot wrote a sales report as an HTML file, or ChatGPT made a review quiz for your class, and you posted it in Teams. Then come the replies: “it's just code,” “the chart is blank,” “the buttons don't do anything.” In Teams, an HTML file arrives as a file instead of a page.
This guide covers how Teams sends an HTML file and what Microsoft's own pages say about why it shows code or does not run. You will see how to post a link that opens the page for everyone, students in a class team included. Microsoft's pages read October 16, 2026. No Teams account was used, and buttons are named as Microsoft's help names them.
How to send an HTML file in a chat or channel
Microsoft's help on sharing files in Teams gives the same steps for a chat and a channel.
- On a computer. Select a channel post or a chat message. In the compose box, choose Actions and apps > Attach file, choose the file, add a message if you like, and select Send. Or drag a file from your computer into the message.
- On a phone. Tap Attach below the typing box. Choose the file from your device or a cloud storage service.
- As a OneDrive link. In Teams, go to OneDrive > My files. Hover over the file, select Share, and select Copy link.
Each way sends the file, or a link to the file. Microsoft's help on file storage in Teams states that “Files you upload to a channel are stored in your team's SharePoint folder.” and “Files you send in chat are stored in your OneDrive for Business and only shared with the people in that conversation.” An HTML file opened from Teams is a file kept in SharePoint or OneDrive.
Why it shows code, a blank page, or dead buttons
The one Microsoft document found on how SharePoint handles HTML files is a developer page for SharePoint Online. It does not name Teams, but Teams keeps its files in SharePoint and OneDrive. Microsoft Q&A, a forum, has reports from 2022 too.
- SharePoint Online doesn't run HTML files with scripts. Microsoft Learn's guide to browser file handling notes that under the strict model, “all files which can potentially cause harm (e.g. a html file having embedded script) are not executed in the browser but downloaded or shown as raw content (html preview in the modern user experience).” It adds, “Today the default setting is strict, and you already cannot switch your tenant to the permissive model.” Raw code on screen fits that rule. A forced download or dead scripts fit it as well.
- HTML is on the preview list, but the list doesn't say how it shows. Microsoft's list of file types you can preview in OneDrive, SharePoint, and Teams places HTM and HTML under “Web/Hypertext,” and HTML again under text and code. The list does not say whether the preview draws the page or runs its scripts.
- A forum answer says JavaScript doesn't run from a SharePoint library. On Microsoft Q&A in July 2022, someone asked why JavaScript did not work in an HTML file opened from SharePoint. The answer, posted as “Tong Zhang_MSFT,” states: “when we open the HTML file in the SharePoint Library, only the part of the HTML can be displayed, and JavaScript does not work, unfortunately, it is by default.” This post is a forum answer. It is not documentation.
- A user reports a blank page after a same-page link. In a Microsoft Q&A question from November 2022, a user says Teams opens an HTML file “in a special Teams HTML viewer window,” and a link to another part of the same page turns it “blank (all white).” Independent advisors answered the question. Microsoft did not write the answers.
- CSS and images in other files don't come along. Teams sends only the one file you pick. A page loading a
style.cssfile or a folder of images loses them. Learn about putting a page in one file in How to share an HTML file as a link.
If they need the code, such as someone who will edit it, send the file. If they need to see the page, send a link.
SharePoint's own HTML pages
Microsoft is adding a way to show HTML as a page inside SharePoint. Its help on HTML pages in SharePoint, dated October 12, 2026, says you can “create an HTML page with Copilot or upload an existing HTML file” and keep it in the Site Pages library. Organizations in the Microsoft Frontier program receive it gradually: “you may not yet see this feature or it may look different than what is described in the help articles.”
If your organization has the feature and everyone who needs the page can open your SharePoint site, it keeps the page inside Microsoft 365. The same help sets its limits:
- “The sandbox supports JavaScript when the code is contained in the same HTML file.” It names “Chart.js, Mermaid, React, Fluent UI, and Babylon from a Microsoft-managed CDN”, while “Other CDN-hosted libraries aren't supported.” A chart loading its library from any other CDN won't draw.
- “The sandbox can't access the browser localStorage.” A quiz keeping a best score in the browser can't keep it.
- “SharePoint blocks arbitrary fetch requests and outbound API calls from HTML pages.” The page cannot send fetch requests or reach out to external APIs.
- Creating or editing a page with Copilot needs a Microsoft 365 Copilot license.
That help covers pages in the Site Pages library. It does not say a file posted in a channel or a chat opens any differently.
Post the page as a link in 4 steps
The link these steps make opens a page on Convika, outside Microsoft 365. Check your organization's rules before you publish anything internal.
1. Put the page in one file
Convika takes one .html or .htm file, up to 2 MB, or the same code pasted into the box. If your CSS or images sit in separate files, ask the AI that made the page, word for word: “Put all the CSS inside the HTML file and use https:// addresses for the images, so the page is one file.” A library loaded from an https:// CDN, such as a charting library, runs on a published page.
2. Drop the file in the box and check the preview
Drop the file in the box at the top of this page, or switch to Paste code, paste it, and click Get my preview link. You do not need an account. When the screen says “Your preview is ready,” open it and check the layout. That preview works 3 minutes. Scripts and forms stay off in the preview, so charts and buttons will not respond yet.
3. Keep the page and publish it
Click Keep this page — free, no card above the preview link, then sign up. The page moves into your account as uploaded, and its scripts run. Click Publish. Under Who can open this page?, choose Public, or select Only people with the password to keep it to people you tell (see “Keep it to your team”). The page goes live at an address like yourpage.convika.page, which stays the same until you click Unpublish. Free includes 10,000 page views a month across all your pages. The Free plan needs no card and gives you 1 published page, with a small Convika bar at the bottom of each page.
4. Paste the link into the chat or channel
On your page's screen, click Copy next to the address under Live URL. Paste it into a chat or channel post and click Send. You can also click Format > Insert link, following Microsoft's help on sending a link. Whoever opens the link sees the page in their browser. They need no Convika account.
Sharing a quiz or game with a class team
You can share a quiz or game that an AI wrote as one HTML file with students the same way: publish it, then post the link. Microsoft's Teams for Education help gives three places for it.
- A post in the class channel. Paste the link into a post. Microsoft's help on announcements in class teams explains that typing “@team” or the team's name in a message notifies the whole class.
- An assignment. In the class team, select Assignments → Create > New Assignment following Microsoft's help on creating an assignment. Under Attach, the attachments help lists: “Link: If there's a hyperlink you wish to provide students, it can be pasted here.”
- Classwork. Go to Classwork, pick a module, and choose + > Link to enter the address, as shown in the help on classwork resources. The page notes: “Only secure links (starting with https) are supported.” Convika's addresses start with
https://.
Students open the link in the browser on a Chromebook, an iPad, a laptop, or a phone. They need no Convika account. A school web filter can block a site it does not know yet, so open the link on one student device before class. To project it, select Show QR code next to the address under Live URL. Students then scan it with a tablet's camera (how to turn an HTML file into a QR code). A page like this serves for practice. It shows each student their own score and sends you none.
To let colleagues reuse the activity, go to Copies of this page in Site settings and tick Let people make their own copy of this page. Copies are off until you do. A line at the bottom of the live page then lets anyone who opens it make their own copy, free, and change it. Copies keep the page's text, names included, so keep students' names off it. To stop copies later, untick it in the same place. Copies already made stay with their makers.
Teaching in Hong Kong? The Our Hong Kong Foundation surveyed 1,200 teaching staff and students. Its report of January 2026 states: “Most frequently used tools are POE and Deepseek.” Either can write a quiz, and a quiz as one HTML file publishes the same way. You can copy a prompt to paste into the chat from How to turn an AI-made quiz into a link.
Keeping it to your team
When you publish, the free choice is Public: anyone with the link can open the page, and it may show up in search results and in Convika's gallery. To keep it out of both, choose Private link (Pro or pass) in the confirmation when you publish. Convika then leaves the page out of the sitemap and tells search engines to keep it out of their results. Still, a private link lets anyone with the link open the page without a password or account, so if someone copies the link from your Teams chat or channel and passes it on—inside your organization or outside it—the recipient can open it too. Here's how to lock it down further and what else to keep in mind:
- Add a password. Publish your file with Only people with the password. Visitors get a password screen first, and Convika sends the page only after they enter the right password. A page password is a Pro feature for $12 a month. Post the link in the channel, and give the password another way. See what visitors see: How to password protect an HTML page.
- There's no Microsoft sign-in. A Convika page has one shared password. It does not use Microsoft 365 sign-in or single sign-on. Anyone with the password opens it, inside your organization or not. If you need to limit a file to people with accounts in your organization, share it inside Teams or SharePoint.
- See whether it was opened. Check your page analytics for visits by day, country, device, and where visitors came from. The Free plan covers the last 90 days. You see how many people visited. You do not see who visited.
- A dashboard that loads internal data won't work. A Convika page sends requests only to its own address, plus, on Pro, the analytics tools it supports. A page pulling live numbers from an internal API or a SharePoint list shows none. Ask the AI to write the numbers into the page. Publish a new version when they change.
Fix the page without changing the link
Upload the changed file to the same page. On the page's screen, look under New version from a file, then drop the file or switch to Paste code. Click Upload as a new version. Uploading uses no AI credits. Once the card says “Preview v2 is ready,” click Open preview to check it. Then click Publish v2 at the same link, and select Publish in the dialog. Until then, people keep seeing the live version. Do not use Upload an HTML file for a fix. It makes a new page at a new address, which the link in Teams doesn't open.
If you have a small change, type it into Improve with AI on the same screen. Each edit uses AI credits: 1 on the default model; Free accounts start with 10. You can also ask Claude, Codex, or another MCP client connected to Convika to save the fixed page as a new version, then publish. Each way keeps the address. The link in the channel or the assignment opens the fixed page.
Frequently asked questions
Can Teams preview HTML files?
Teams lists HTM and HTML as previewable file types, but Microsoft does not say whether the preview draws the page or runs its scripts. Teams keeps its files in SharePoint and OneDrive. According to Microsoft's SharePoint docs, SharePoint Online downloads an HTML file with embedded script or shows it as raw content.
Why does my HTML file show code in Teams?
Microsoft's SharePoint docs say SharePoint Online displays files with embedded script as raw content. A channel stores its files in the team's SharePoint folder. Microsoft's SharePoint docs state that you cannot switch off this strict handling. To show the page, publish the file and post its link.
Why doesn't JavaScript run in an HTML file in Teams?
Microsoft's docs say SharePoint Online blocks embedded scripts under its default strict handling. According to Microsoft's docs, a file with embedded script is “not executed in the browser.” A 2022 answer on the Microsoft Q&A forum confirms the same result for an HTML file opened from a SharePoint library. On a page published with Convika, scripts run on every plan, Free included.
How do I share an HTML file in Teams as a link?
Publish the file first, then paste its address into the chat or channel. A OneDrive link from Copy link shares the file instead of rendering the page. The upload box on this page checks your file. A free Convika account publishes it at an address that stays the same until you unpublish it.
How do I share a quiz with my class in Teams?
Ask the AI for the quiz as one HTML file, publish it, and paste the link into Teams. You can add the link to a class post, put it in Classwork, or click Attach > Link inside an assignment. Students open it in the browser without an account. Open the link on one student device first, in case the school's web filter blocks it.
Can I password-protect a page I share in Teams?
Yes, you can password-protect your page on Convika's Pro plan. Choose Only people with the password when publishing, post the link, and give the password separately. The page uses one shared password rather than a Microsoft sign-in.
Next step
How to password protect an HTML page without code, on your own domain
JavaScript passwords sit in the page code. Put an HTML page from ChatGPT or Claude behind a server-checked password on your own domain.
Related articles
- How to share an HTML file as a link that opens on any phoneEmail and Google Drive open HTML files on a phone without scripts. Compare 5 hosts (Netlify Drop, Tiiny Host, GitHub Pages, Convika) and follow 4 steps.
- Turn an AI-made quiz or review game into a link your students can openAsk ChatGPT, Claude, or Gemini for the quiz as one HTML file, publish it free, and give students a link or a QR code with no student accounts.
- Turn an HTML file into a QR code people can scanA QR code holds a link, never the file. Publish the HTML page at an address that stays. Show its QR code in the dashboard and download it as a PNG.
- How to see who visits a page you made with AICount visitors and see where they came from on a page ChatGPT, Claude, or Gemini made. GA4, Cloudflare, Plausible, Clarity, and Convika compared.
- How to Send an HTML File by Email (Gmail, Outlook, or Link)Gmail and Outlook let you attach .html files, though work filters can block them and mail apps may show code. Or publish it and email a link instead.
- Share a Copilot HTML Page or Quiz Without Sign-InShared Copilot chats need a sign-in and Copilot Pages stay inside your org. Copy Copilot's HTML and publish a link anyone can open without an account.