Forums | Mahara Community
Swiffy - SWF to HTML5 converter
17 January 2015, 4:03
Does anyone have a workaround or alternative solution to this problem?
19 January 2015, 19:22
Can you generate an iframe and use that for embedding the content?
19 January 2015, 22:45
When I try to add it using an iframe it generates an error
You are viewing …(filename by user)
The file displayed below has been filtered to remove malicious content and is only a rough representation of the original.
20 January 2015, 12:22
It sounds like you have uploaded the HTML5 file into your Portfolio, then added your Mahara site to its own list of allowed iframe sources, and then used then "view" URL for your HTML5 file as the iframe source?
As you have noticed, that won't work. :(
Mahara provides three ways to display a user-uploaded HTML file, and none of them will work for what you want to do.
- The download link for an HTML file (e.g. http://example.com/artefact/file/download.php?file=8&view=8 ): Also runs the file contents through HTMLPurifier, and adds those headers you mentioned that say "You are viewing ___ by ___. The file displayed below has been filtered..." etc
- The "force download" link for an HTML file. This is the URL used in the link that says "Download the original version" in the header for #2. It's the same URL, but with &download=1 added to it. This does give you the full, unfiltered file, but it also adds a MIME type that tells the browser to download the file instead of displaying it, which makes it not useable as an iframe source.
I think your options are:
- Host the file outside of Mahara, and load it using an iframe
- OR, write a new Mahara block to display uploaded HTML files without filtering them. Perhaps make it accessible only to staff & admins, for security reasons.
- OR, hack Mahara to deactivate HTMLPurifier for uploaded HTML files, again maybe only for staff & admins
20 January 2015, 21:53
Thanks for confirming.
Of the available options I guess #1 is the only viable one for me to look at as I'm not allowed to hack code or install new plugins in my current role :(