Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Converts a file path to a local file URL.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Path | 5.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
Path | The absolute file path to convert to URL. | "/Users/cs/Desktop/test.html" |
Returns URL or error.
Converts a path to a file URL
/* shows: file://localhost/Users/cs/Desktop/test.html */
MBS( "Path.FilePathToFileURL"; "/Users/cs/Desktop/test.html" )
Converts a Windows path to file URL:
MBS( "Path.FilePathToFileURL"; "C:\Users\Christian\Desktop\test.html" )
Write a HTML file and an image file to load in web viewer:
Set Variable [ $folder ; Value: MBS( "Folders.UserTemporary" ) ]
Set Variable [ $path ; Value: MBS( "Path.AddPathComponent"; $folder; "test.jpg" ) ]
Set Variable [ $r ; Value: MBS( "Container.WriteFile"; Images::Image; $path ) ]
#
Set Variable [ $html ; Value: "<html><body><p>Hello World</p><img src=test.jpg width=300></body></html>" ]
Set Variable [ $path ; Value: MBS( "Path.AddPathComponent"; $folder; "test.html" ) ]
Set Variable [ $r ; Value: MBS( "Text.WriteTextFile"; $html; $path ) ]
#
Set Variable [ $URL ; Value: MBS( "Path.FilePathToFileURL"; $Path ) ]
Set Web Viewer [ Object Name: "web" ; URL: $URL ]
This function checks for a license.
Created 30th January 2015, last changed 23th February 2020