# Why your HTML file shows code or downloads in Drive or Teams

URL: https://tossithere.com/guides/html-file-shows-code
Published: 2026-11-18 · Updated: 2026-11-19 · By Kush Daga, maker of tossithere

> An uploaded HTML file may be treated as a file preview or download instead of a hosted page. Google Drive lists HTML as Markup/Code and ended web hosting in 2016; Microsoft documents download restrictions for HTML in SharePoint libraries, where Teams channel files live. Slack documents file previews without promising HTML page rendering. Upload the page and its assets to a web host, then check who can open the link.

You made a page, maybe a report your AI agent wrote as HTML, and sent it to someone. They wrote back with a screenshot of angle brackets, or a file that downloaded and opened with its images missing. The file may be fine. A file preview is different from a hosted page.

Here is what the common apps document about an `.html` file as of November 2026, and how to share a hosted page instead. We make tossithere, which is one of the fixes, so weigh that.

## Why does an HTML file show code instead of the page?

An HTML file shows as code when the app opening it treats it as a document to preview rather than a page to run. A browser renders HTML when it loads it from a web address or opens it from your own disk. Google Drive and Microsoft 365 list HTML among their code previews, and SharePoint can make people download it instead. Those preview lists do not promise to run the page. If a downloaded page refers to local images or scripts that were not sent, those parts will be missing.

## Google Drive: why does my HTML file open as code?

Google Drive lists HTML among its "Markup/Code" preview types, next to CSS, JavaScript and Python, in [Google's own list of previewable files](https://support.google.com/drive/answer/37603?hl=en). That classification suggests a code preview; it does not promise a hosted web page.

Drive used to offer web hosting. Google deprecated web hosting in Drive in 2015 and ended serving content from googledrive.com/host on August 31, 2016, according to its [Workspace Updates announcement](https://workspaceupdates.googleblog.com/2015/08/deprecating-web-hosting-support-in.html). That discontinued hosting feature is no longer available.

## Microsoft Teams and SharePoint: why does the HTML file download?

SharePoint Online restricts opening HTML files from document libraries in the browser. Microsoft's SharePoint migration guide says the Strict browser file handling setting is enforced in SharePoint Online and can't be changed, so "*.htm and *.html files in document libraries no longer open in the browser. Users are prompted to download the files" ([Microsoft Learn](https://learn.microsoft.com/en-us/sharepointmigration/migration-assessment-scan-browser-file-handling)).

Files shared in a Teams channel live in that team's SharePoint site ([Microsoft Learn](https://learn.microsoft.com/en-us/sharepoint/teams-connected-sites)). That SharePoint restriction is relevant to HTML files shared in Teams channels. Microsoft's preview list for OneDrive, SharePoint and Teams lists HTML under both "Text and Code" and "Web/Hypertext", but doesn't say a preview runs the page ([Microsoft Support](https://support.microsoft.com/en-us/onedrive/file-types-supported-for-previewing-files-in-onedrive-sharepoint-and-teams)).

## Slack: can it show an HTML page?

Slack previews files you upload, but its [help page on adding files](https://slack.com/help/articles/201330736-Add-files-to-Slack) doesn't say it renders HTML as a page, so don't count on the recipient seeing more than a file. Send a link instead, and the page opens in their browser.

## What about email?

Email can carry an HTML file: Gmail's [list of blocked attachment types](https://support.google.com/mail/answer/6590?hl=en) doesn't include `.html`. A recipient may need to download it and open it in a browser. Sending a revised attachment gives them another copy; the attachment itself does not provide a shared comment thread.

## How do I fix it?

Put the file on a web host and share the address. Upload the HTML and its assets together, then check that the intended recipient can open the web address.

1. **Gather the file and anything it loads.** If the page uses images, CSS or scripts saved next to it, keep them together in one folder. A single self-contained HTML file is fine on its own.
2. **Upload it to a host.** For a one-off, [Netlify Drop](https://docs.netlify.com/start/quickstarts/netlify-drop-quickstart/), [Vercel Drop](https://vercel.com/docs/drop) and [Cloudflare Drop](https://www.cloudflare.com/drop/) take a dragged folder with no account to start, as of November 2026. Claim the site before you send the link: an unclaimed Netlify drop sits behind a temporary password, Cloudflare gives you 60 minutes to claim, and Vercel's temporary deploys expire unless claimed. On Netlify, check the project's visibility after claiming too: on credit-based plans, a team with private-by-default enabled can keep a claimed project private until you make it public. Our guide on [how to share an HTML file as a link](/guides/share-html-file-as-link) compares all the options, and [tiiny.host alternatives](/compare/tiiny-host-alternatives) covers the hosts in more detail.
3. **Paste the link** into Teams, Slack, the email or the Drive comment where the file was going to go.

If an AI agent made the page and you expect changes, use a host it can publish to directly, so you don't redo the upload for every version. With tossithere, the agent runs `toss report.html` and gets a link. A signed-in push is private by default, so share the document with the intended reviewers before sending it. A push without an account is public and expires after 24 hours unless claimed. Reviewers sign in with Google to comment on an element or highlighted text; the agent reads those comments and publishes v2 to the same link. There are setup guides for 23 agents, for example [Claude Code](/agents/claude-code), [Codex](/agents/codex) and [Cursor](/agents/cursor). For a comparison of publishing and reviewer access, read [Claude Code Artifacts vs tossithere](/compare/claude-code-artifacts-vs-tossithere).

## Questions

### Can I make Google Drive render an HTML file?

Drive no longer offers web hosting for HTML files. Google ended web hosting from Drive on August 31, 2016, and Drive lists HTML among its code preview types. Upload the file to a web host and put that link in Drive instead.

### Why does my HTML file download when I click it in Teams?

Teams stores channel files in SharePoint. According to Microsoft's documentation, SharePoint Online enforces Strict browser file handling, which prompts people to download `.htm` and `.html` files rather than open them in the browser. Microsoft lists HTML among its preview formats without promising that the preview runs the page.

### Why do the images and styles disappear when someone opens my HTML file?

If the page loads images or styles from local files that were not sent, those assets will be missing. Check the file paths too. Host the whole folder, or have your agent write one self-contained file with everything inline.

### What is a quick way to send an HTML page to someone?

Upload it to a drag-and-drop host such as Netlify Drop, Vercel Drop or Cloudflare Drop, claim it, make sure it's public, and send the link. If you want comments on it, see the last step under "How do I fix it?" above.

## Sources

- Google Drive Help, "Files you can store in Google Drive", read November 19, 2026: https://support.google.com/drive/answer/37603?hl=en
- Google Workspace Updates, "Deprecating web hosting support in Google Drive", August 2015, read November 19, 2026: https://workspaceupdates.googleblog.com/2015/08/deprecating-web-hosting-support-in.html
- Microsoft Learn, SharePoint browser file handling, read November 19, 2026: https://learn.microsoft.com/en-us/sharepointmigration/migration-assessment-scan-browser-file-handling
- Microsoft Learn, "Overview of Teams and SharePoint integration", read November 19, 2026: https://learn.microsoft.com/en-us/sharepoint/teams-connected-sites
- Microsoft Support, file types supported for previewing in OneDrive, SharePoint and Teams, read November 19, 2026: https://support.microsoft.com/en-us/onedrive/file-types-supported-for-previewing-files-in-onedrive-sharepoint-and-teams
- Netlify Drop quickstart, read November 19, 2026: https://docs.netlify.com/start/quickstarts/netlify-drop-quickstart/
- Vercel Drop docs, read November 19, 2026: https://vercel.com/docs/drop
- Cloudflare Drop, read November 19, 2026: https://www.cloudflare.com/drop/
- Slack Help, "Add files to Slack", read November 19, 2026: https://slack.com/help/articles/201330736-Add-files-to-Slack
- Gmail Help, file types blocked in Gmail, read November 19, 2026: https://support.google.com/mail/answer/6590?hl=en
