7 Replies Latest reply on Jun 8, 2017 6:05 AM by jerrysalem

    server path



      I try to run a script on server to generate a pdf file and store it in a container field, so users can se the report with a simple click instead of having to generate it each time.

      I have heard, that in fms16 you can do that now in Server.. but the "insert pdf" command is still dimmed. So I tried Insert from URL, which work on server.

      My script finds records, sorts them, sets $caminho to Get(TemporaryPath)$nameofmyfileDDMMYYHHMM, saves the .pdf and inserts from URL into a container field.


      Thereby I observed that on a client machine the path (obtained with GET(TemporaryPath) to get the URL one has to substitute the name of the HD with file:///private/.

      from this


      get this.


      Which was easy with the replace function.

      On a client my script works fine.

      But on the server the path becomes:


      And testing this in the browser on the Server machine I cannot access the file.

      Where do I have to create the pdf to, so that I can read it into a container field and serve it to clients. Or how can I modify the script so it runs on server (or better still on clients and server).



        • 1. Re: server path

          I found 10 years old function, FileMaker Custom Function:FilePathToURL ( FMFilePath )

          Does adding "Volumes" not work on recent FMS?

          • 2. Re: server path

            OSX? does it have any relation to this thread:

            "Web Viewer, OSX10.12.4  The local path pattern is no longer valid. Why?"

            • 3. Re: server path

              Hi User..

              thanks for you reply. Sorry I only saw it now.. some spam filter.


              I managed to do it all in filemaker native.

              The secret is to use get(documents path ), it seems that server does not access the Temporary folder as well as the Library/Filemaker Server/Documents folder.


              I am a bit proud..hehe..

              My script does, check if it IS on server, calculate a path, $caminhoserver save a pdf to this path and then uses Insert from URL to import from this pdf at $caminhoserver which is on the following place:


              /server100gb/Library/FileMaker Server/Data/Documents/relmat19-05-2017h1545.pdf  change it to URL notation

              file:///Library/FileMaker Server/Data/Documents/relmat19-05-2017h1545.pdf


              To clean up it uses Export Records with an empty set to delete this file.

              • 4. Re: server path


                no.. it is no bug.. I think. I think that Filemaker server can only write to Get( TemporaryPath).. but not read afterwards, since, as I understood it, this folder is deleted after the script. .... Or at least I could not make it work.


                However I managed to create a pdf on server, save it to Get(DocumentsPath), then import that .pdf with the Insert from URL script step into a Container field, so that Users can always access this file/report with click. Then I delete the pdf file in the Library/Filemaker Server/Documents folder by Export Records with an empty set.

                • 5. Re: server path


                  Here a pdf of the script.

                  • 6. Re: server path

                    Yes, the Documents (relative to FMServer, not a User!) and Temporary directories are available to FMS. The Temp does delete automatically.


                    If you need to delete from the Documents folder, there are thread here (and elsewhere) to show you ways.


                    • 7. Re: server path

                      I am having a similar problem on a FileMaker Server 16 hosted file on a PC.

                      I have a similar script running without problems on a FMS15 hosted file on a PC.  It works using the Temp directory just fine, by the way.


                      But in a different file, also on a PC but hosted on FM16 the Insert from URL is failing.


                      Any other suggestions?