Include HTML file in a Confluence page

Ramon Padilla August 20, 2014

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
Ramon Padilla August 26, 2014

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.

1 vote
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2014

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

Ramon Padilla August 25, 2014

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.

1 vote
Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2014

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.)

0 votes
Tarun Sapra December 7, 2017

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.

0 votes
William Zanchet [Atlassian]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2014

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

Ramon Padilla August 25, 2014

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.
 
 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events