HTMLViewer local file access

I have an HTMLViewer that accesses a remote website. One of the images on the web page is a local file on the users system (file:///). In normal web browsing this is not accessible for security reasons.

For Windows, I was able to modify a registry setting for my app to allow a remote web sites to access local files. Is there a similar setting for OSX?

Err… what?
Why would a remote website ever access a local file?

I would reverse that setting on Windows, and move the image to the remote server.

Why not replace the image url tag with a div in the remote page, load the page in the htmlviewer, load the image locally and create an img src tag with the image as base64, then force it into the div using EcecuteJavascript? Then there’s no security risk, and everything after loading the page is handled locally. :slight_smile:

The base64 image tag format is:

of course replacing png with jpg if JPEG format. Everything after the “base64,” is merely the image as a string encoded using Encodebase64().

Something like this would work…


Htmlviewer.ExecuteJavaScript(“document.getElementById(‘placehere’).innerHTML=” + the generated base64 image tag + “;”)

That should do the trick :slight_smile: