# Open .htm attachment in a new tab

**URL:** <https://forum.xwiki.org/t/open-htm-attachment-in-a-new-tab/17510>\
**Category:** Help / Discuss\
**Tags:** attachments, html\
**Created:** [August 14, 2025, 9:36am UTC](https://forum.xwiki.org/t/open-htm-attachment-in-a-new-tab/17510 "2025-08-14T09:36:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![georgiys](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/g/c6cbf5/32.png) [@georgiys](https://forum.xwiki.org/u/georgiys)\
**Post date:** [August 14, 2025, 9:36am UTC](https://forum.xwiki.org/t/open-htm-attachment-in-a-new-tab/17510/1 "2025-08-14T09:36:25Z")

</div>

Hello,

How I make an attached html file (.htm) to open directly in the browser?

For example, let’s say I have 2 attachments: image1.jpg and page1.htm. Then, in my XWiki page I have these 2 links:

```auto
[[image>>attach:image1.jpg||rel=“noopener noreferrer” target=“_blank”]]

[[htm page>>attach:page1.htm||rel=“noopener noreferrer” target=“_blank”]]

```

When I click on the first link, it opens in a new tab with an address: https://…/xwiki/bin/download/…path…/WebHome/image1.jpg

However, when I click on the second one, it first downloads the page.htm file to my local PC and then loads it in the browser with: file:///C:/Users/user/Downloads/page1.htm

Is there a way to open the second link directly from XWiki as well? Thanks!

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 16, 2025, 12:43pm UTC](https://forum.xwiki.org/t/open-htm-attachment-in-a-new-tab/17510/3 "2025-09-16T12:43:39Z")

</div>

I think this is a behavior of your browser. You should research in this direction IMO.

To debug the issue, you can easily check the HTML that XWiki generates by viewing the HTML source in your browser.

---

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [September 17, 2025, 12:17pm UTC](https://forum.xwiki.org/t/open-htm-attachment-in-a-new-tab/17510/4 "2025-09-17T12:17:43Z")

</div>

This is for security reasons (possibility of XSS). When the user in XWiki who uploads the file has programming rights, the HTML file should also open in the browser.
