Include HTML file in a Confluence page

Is it possible to include an HTML file in a Confluence page using the html-include macro?

I've configured the macro as follows:

file://Users/<path-to-file>

and tried to configure the whitelist entry for that location as follows:

file://Users/<path-to-file>

but I'm still getting the message:

Could not access the content at the URL because it is not from an allowed source.

file:///Users/<path-to-file>

Configure whitelist >>

Any ideas what I'm doing wrong?

5 answers

1 accepted

0 votes
Answer accepted

It seems there are issues linking to local files in Confluence. See https://confluence.atlassian.com/x/MYXuD.

I resolved the issue by setting up a local web server that can host the content using another protocol which won't trigger this error as suggested in the above link.

I don't think you can use the file protocol with this. That makes sense -- for a different user on a different computer, it would point to a different file.

(From the error message you get, it also might be that the whitelist needs to be configured for your Confluence instance -- you need to be a Confluence admin to do that. However, my whitelist is configured to allow anything, and the file protocol still doesn't work for me.)

Hi,

You can use Confluence a your file directory. You just need to drop the file in the <install-folder>/confluence that way you should be able to get this file from Confluence.

Cheers,
WZ

I've tried all sorts of permutations and I just can't get this to work. Please can you elaborate.

In order to simplify this I've added a file to the Confluence install folder and tried using the HTML macro.

{html}<a href="file:///<path-to>/file-name.html> </a>{html}
 
I can open the file I'm pointing to in Chrome.
 
 

You can use the HTML Macro from HTML for Confluence - it allows you to have the HTML source come from the file system.

It shouldn't be necessary to install this in order to achive what I want to though should it? We don't allow exernal access to Confluence and the html files I want to diplay are on the company network.

Hello All,

My use case is to allow HTML tags to be executed and rendered (like tables) but not to execute any JS/CSS. Is there a to implement it.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Tuesday in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

211 views 2 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you