Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Path.FilePathToFileURL
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 |
Parameters
Parameter | Description | Example |
---|---|---|
Path | The absolute file path to convert to URL. | "/Users/cs/Desktop/test.html" |
Result
Returns URL or error.
Description
Converts a file path to a local file URL.Examples
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 ]
See also
Release notes
- Version 13.4
- Fixed a problem with Path.FilePathToFileURL for Windows.
Example Databases
- CURL/Email/Email Parser and Preview
- CURL/Email/IMAP Email
- Network/ServerSocket/ServerSocket from Webviewer/ServerSocket from Webviewer
- WebViewer/Calendar/Calendar
- WebViewer/MethodDraw SVG Editor/MethodDraw
- WebViewer/WebViewer MarkDown/WebViewer MarkDown
- Win Only/Windows Player
Blog Entries
- MBS Plugin Advent calendar: 7 - Paths
- MBS FileMaker Plugin, version 13.4pr3
- Use Inline Graphics in Emails
- Windows Media Foundation Player for FileMaker
- FileMaker and WebViewer communication
- MBS FileMaker Plugin, version 5.0pr9
This function is free to use.
Created 30th January 2015, last changed 20th February 2024