Forums | Mahara Community

Support /
Swiffy - SWF to HTML5 converter


Gordon McLeod's profile picture
Posts: 197

17 January 2015, 4:03

HI,

I have some legacy SWF files that I'm trying to convert to HTML5 to be device agnostic (I don't have the original source .fla). I did a test with Google Swiffy which allowed me to save the file as html, and on opening in a browser it looks and acts just like the original - but when I try to load it to Mahara it just displays a blank block. Looking at the code from the swiffy output it's contained within javascript which is presumably being stripped out.

Does anyone have a workaround or alternative solution to this problem?

Thanks, Gordon.

Kristina Hoeppner's profile picture
Posts: 4717

19 January 2015, 19:22

Hi Gordon,

Can you generate an iframe and use that for embedding the content?

Cheers

Kristina

 

Gordon McLeod's profile picture
Posts: 197

19 January 2015, 22:45

Hi Kristina,

 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.

Aaron Wells's profile picture
Posts: 896

20 January 2015, 12:22

Hi Gordon,

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.

  1. The HTML media block: Runs the HTML contents through HTMLPurifier, stripping out all Javascript and abuse-able HTML tags (which probably includes some of the exciting parts of HTML5)
  2. 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
  3. 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:

  1. Host the file outside of Mahara, and load it using an iframe
  2. 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.
  3. OR, hack Mahara to deactivate HTMLPurifier for uploaded HTML files, again maybe only for staff & admins

Cheers,

Aaron

Gordon McLeod's profile picture
Posts: 197

20 January 2015, 21:53

Hi Aaron,

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 :(

Regards, Gordon.

5 results