4 Replies Latest reply on Feb 9, 2017 4:28 PM by user19752

    Global File Path for Referenced Files


      I want to store the file name (ie  workrules.pdf) in a text field and the network path to the folder containing all of my referenced files in a global field (ie //server/maintenance).   I'm an all windows environment.


      I then want to create a link on my layout to open the file, but my calculation to build the entire file path isn't working.


      Do I need a mapped network drive?  Can I use the path //xxx/xx//x//?  Am I missing some brackets around the / or \ or ? 


      Thanks in advance!


        • 1. Re: Global File Path for Referenced Files

          Why not use container fields instead? Much simpler.


          How are you using that file path? Open URL? The web Browser? Send Event? or ???


          What does your calculation look like?

          Note that in a string of quoted text, \ is used as the escape character. When FileMaker evaluates a quoted string of text, it drops out the escape character and treats the next character as just another character and not, say " marking the end of a quoted string.



          "This is quoted \"text\" "

          evaluates as:

          This is quoted "Text"


          So in a file path using \, you have to double them:



          and you may not need to use \ in most cases as you can use / instead in FileMaker file paths.


          And yes, any networked drive needs to be mapped and mounted and if it gets mapped to a different drive letter, the path has to change to prevent that.


          I use a batch file exported and opened from FileMaker to map needed drives to the correct letters on one system as it seems that the workstations mysteriously disconnect from the mapped drives from time to time so I gave them a button to map the drive.

          • 2. Re: Global File Path for Referenced Files

            I'll play with the string and the double
            .... thank you!


            I've used container fields, but haven't been successful in a simple double

            click being able to open the contents.  I've had to "export" the content

            before it will open.


            More advice on using a container field that I'm missing???  I'm open to

            either approach, but my export first requirment made it cumborsome for my

            frequent generation of the embedded file.

            • 3. Re: Global File Path for Referenced Files

              IF you do all of the following exactly:


              Use the option to store a reference to the file when inserting the file.

              Do not use external storage

              Do not format so that it is "optimized for interactive content", then a double click on the container field will open the original copy of the file.


              But note that you have never actually inserted the file into the container field, only it's file path. This has both file access and file management issues that can complicate your life.


              On the other hand, you can use a single button click to open the file via export field contents to open a copy of the file and this works with all options you might specify when working with container fields. The downside is that this is a copy of the actual file, not the original. If you then make changes to the file while it has thus been opened, the changes will not be there when you export a copy again from the container field unless you also insert the new modified copy back into the container field.

              • 4. Re: Global File Path for Referenced Files

                On your case (all Widows), you can use

                Open URL [ "file:" & yourpath ]

                yourpath can be both //server/share/file and \\server\share\file