HTML containing FM bookmarked local images > WebView

I have a folder of images in iCloud Drive in files. I can set a FileManager bookmark and list the directory–works great, produces an array of filenames.

What I want to do is construct (in a script) an HTML page that has all of those images one right after the other and then send that to a WebView. Basically what I have is:

var fm = FileManager.iCloud()
file = fm.bookmarkedPath("logos")
files = (fm.listContents(file))

for (i=1;i<files.length;i++){ 
var oneimg = fm.joinPath(file, files[i]);
html += '<img src="file://'+oneimg+'" >';
html += '<p>'+oneimg+'</p>'
}
WebView.loadHTML(html)

I’m pretty sure what’s happening is I’m not constructing a valid URL for the image that WebView can parse within an html document. I’ve tried it with “file://” and “shareddocuments://” as a prefix to the path. No luck.

Any advice? Thanks if you can.

Looks like WebView can’t access bookmarked files. You could try to load the images as base64 and embed them with a data URL.