AnsweredAssumed Answered

FM16 web viewer Javascript local file loading

Question asked by barryj on Jul 23, 2017
Latest reply on Oct 26, 2017 by TSGal

Hi,

I have some code that's been working fine up until FM16 and now fails. I have created an offline database and use the webviewer to display a map from tiles stored locally on the device. I have an HMTL file along with several javascript libraries stored in a subfolder of the FMP database location.

I know HTML 5 has tighter security than earlier versions, but according to the docs it allows loads from the folder the html file is in and one subfolder deep.

The map tiles all exist inside one large file (300MB or larger) and I used to be able to access this file using this code:

 

var xhr = new XMLHttpRequest();

xhr.open('GET', 'file:./mapTiles.mbtiles', true);

xhr.responseType = 'arraybuffer';

xhr.onload = function(e) { all the stuff to handle the file in here};

xhr.send();

 

It appears to be a security issue specific to FM16 as my html mapping works perfectly in Safari and loads the map tiles file, so it's not a bug in my code.

I know there are options to base64 encode binary data and embed it into the html, but it's not practical for me due to the size of the file.

Is there a suitable workaround for this?

Alternatively can we get an update to Filemaker that brings this security issue into line with Safari and the general HTML5 spec?

 

System:

OSX Sierra Vers 10.12.4

FileMaker Pro 16 Advanced.

Cheers,

Barry.

Outcomes