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” )
Hopefully the image now appears in your web viewer.
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
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.
Thanks,
I was looking for an answer for this doubt and googled in your website.
It works flawless.
Hello,
I found your answer concerning pictures. Is that possible for pdf files stored in a folder ?
Thanks
Noël