Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Path.FileURLToFilePath

Converts a file URL to a local file path.

Component Version macOS Windows Linux Server iOS SDK
Path 5.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Path.FileURLToFilePath"; URL )   More

Parameters

Parameter Description Example
URL The file URL to convert. "file://localhost/Users/cs/Desktop/test.html"

Result

Returns path or error.

Description

Converts a file URL to a local file path.

Examples

Converts a path URL:

/* returns /Users/cs/Desktop/test.html */
MBS( "Path.FileURLToFilePath"; "file://localhost/Users/cs/Desktop/test.html" )

Example result: "/Users/cs/Desktop/test.html"

Converts file URL on Windows to path:

MBS( "Path.FileURLToFilePath"; "file://C:/Users/Christian/Desktop/test.html")

Example result: "/Users/Christian/Desktop/test.html"

Blog Entries

This function is free to use.

Created 30th January 2015, last changed 20th February 2024


Path.FilePathToFileURL - Path.LastPathComponent