Accessing a local file through web viewer in FileMaker

Whilst working on a project this week I had to access an image from a local directory on the hard drive through the FileMaker web viewer. It’s not as obvious as it might first appear. To start with you can’t just access the path directly.

Here’s a quick tip that might save some time of hunting through help files and forums.

So you start off with a path that’s something like this …

C:\Documents and Settings\User\My Documents\Images\My Image.jpg

If you copy and paste that into Internet Explorer you’ll find it works. But not so when you put it into the web viewer in FileMaker.

There are two key things you need to do.

1. Place some text in front of the path: “file:///”

2. FileMaker can’t intelligently translate the spaces in the path into URL, so you need a substitue command. Replacing all the spaces with %20

So your line in the web viewer will look something like this…

“file:///” & Substitute( “C:\Documents and Settings\User\My Documents\Images\My Image.jpg” ; ” ” ; “%20”  )

FileMaker Web Viewer

Hopefully the image now appears in your web viewer.

Paul de Hallé

Paul de Hallé

Paul de Hallé is the CEO and founder of Linear Blue, having set up the company in 1999 to focus on intuitive database solutions and web integration. Paul is a FileMaker Certified developer; and has also been a key player in the implementation of the FileMaker Certification program since it's inception with FileMaker 7. A regular guest speaker at FileMaker Business Alliance & Technet meetings in the UK and the FileMaker Developers Conference in the USA, along with contributing to various technical publications around the world.

More Posts - Website - LinkedIn

4 thoughts on “Accessing a local file through web viewer in FileMaker”

  1. Thanks this helped. But have trouble replacing the file name with a field that contains the file name. That is, the “image_11.JPEG” in your example above if replaced with a field that carries the file name … is not recognized.
    With thanks again, A

    1. This should work…

      “file:///” & Substitute( “C:\Documents and Settings\User\My Documents\Images\” & Field_Name ; ” ” ; “%20” )
      “file:///” & Substitute( “C:\Documents and Settings\User\My Documents\Images\” & Field_Name & “.jpg” ; ” ” ; “%20” )

      Depending on whether or not your field contains the file name suffix, you may need to add it manually.

Leave a Reply