Brian Dunning's FileMaker Custom Functions

FilePathToURL ( FMFilePath )

Convert from FileMaker filepath to URL

  Average rating: 3.8 (45 votes) Log in to vote

Tom Robinson   Tom Robinson - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
FilePathToURL ("file:/startupvol/Users/tom/fold & er/filepath.fp7")
  Sample output:
file:///Volumes/startupvol/tom/Temp/fold & er/filepath.fp7

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Useful for using the result from Get(FilePath) and Get(TemporaryPath) in an Open URL or Web Viewer

Examples (from / to):

Case A: OS X, FileVault protected home folder, normal folder, network folder, e.g. ‘Hard Drive’
file:/Hard Drive/Desktop/fold & er/filepath.fp7
file:///Volumes/Hard Drive/Desktop/fold & er/filepath.fp7
Note Open URL fails for FileVault protected volumes under OS Ⅹ 10.4

Case B: Windows, UNC volume
file://comp/share/fold & er/filepath.fp7
file:\\comp\share\fold & er\filepath.fp7

Case C: Windows, drive letter, e.g. ‘C’
file:/C:/Documents and Settings/Administrator/My Documents/fold & er/filepath.fp7
file:///C:/Documents and Settings/Administrator/My Documents/fold & er/filepath.fp7

Case X: OS Ⅹ, Get(TemporaryPath)
/Amphe/private/var/tmp/folders/501/TemporaryItems/FileMaker/
file:///Volumes/Amphe/private/var/tmp/folders/501/TemporaryItems/FileMaker/

Case Y: Windows, Get(TemporaryPath)
/C:/Documents and Settings/Administrator/Local Settings/Temp/
file:///C:/Documents and Settings/Administrator/Local Settings/Temp/

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: