OpenUrl with local html file.

Monkey Forums/Monkey Beginners/OpenUrl with local html file.

tbarela(Posted 2014) [#1]
Hi,

I'm having no luck opening an html file in the data directory. Everything works fine with web urls. I've looked, and the file is definitely there in the build directory.

I've tried:

OpenUrl "docs/instructions.html"
OpenUrl "monkey://data/docs/instructions.html"
OpenUrl "file://docs/instructions.html"

(... though I realize that last one probably needs an absolute path )

I've been mostly testing on the desktop target, but android is needed too. Is this just not possible?


dawlane(Posted 2014) [#2]
For the Desktop it's easy enough to do. But the other targets are another matter.
Import mojo
Import os

#TEXT_FILES="*.txt|*.xml|*.json|*.html"
Function Main:Int()
	OpenUrl "file:///" + CurrentDir().Replace("\\", "/") + "/data/instructions.html"
	Return 0
End Function



tbarela(Posted 2014) [#3]
Thanks. Yeah it works on desktop, but its a no go on Android :/


nikoniko(Posted 2014) [#4]
tbarela wrote:
but its a no go on Android :/


Security issue?


nikoniko(Posted 2014) [#5]
Test this code
OpenUrl(PathToFilePath("monkey://data/Index.htm"))