Home > Database, FileMaker > Accessing a local file through web viewer in FileMaker

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é

About Paul de Hallé


Paul de Hallé is the founder and Development Director of Linear Blue, having set up the company in 2000 to focus on intuitive database solutions and web integration. Paul is a FileMaker Certified developer on versions 7 to 11; 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 Paul is also a contributor to Advisor magazine, the leading industry Database publication.

Categories: Database, FileMaker Tags: ,
  1. Abizar
    July 11th, 2010 at 11:18 | #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

    • September 2nd, 2010 at 11:05 | #2

      This should work…

      “file:///” & Substitute( “C:\Documents and Settings\User\My Documents\Images\” & Field_Name ; ” ” ; “%20″ )
      or
      “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.

  2. Daniel
    December 21st, 2010 at 09:00 | #3

    Thanks,
    I was looking for an answer for this doubt and googled in your website.
    It works flawless.

  1. No trackbacks yet.

Comment Spam Protection by WP-SpamFree