2 Replies Latest reply on Sep 5, 2014 6:20 AM by dburnham

    Server file paths

    dburnham

      I have a solution in which the users are placing a CSV text file into a container field, with the intention of a triggered scipt executing a subsequent Perform Script on Server script that will import the contents of the CSV file into one of the database's tables as new records.

       

      Perform Script on Server does not allow Export Field Contents. Therefore, I am relying on the container field's external storage to place the CSV file into either the server's TemporaryPath or DocumentsPath. While debugging the script, I'm working with the latter (DocumentsPath) because it's visible to me.

       

      The problem I'm having is how to define the external storage. It begins with [hosted location]/DatabaseFileName/ which would be OK if I could figure out how to navigate backward (upward) in the hierarchy to get to the Documents folder located at FileMaker Server/Data/Documents

       

      Because this is a cross-platform solution that will run on both Mac and Win Servers, I suppose I could use two different paths,

      one that begins with filewin:/C:Program Files/FileMaker/FileMaker Server

      and the other one beginning with filemac:/Macintosh HD/Library/FileMaker Server

       

      but I prefer to use relative paths that I can specify in my script with variables.

       

      Right now, I have the CSV file being placed into the default location that I am given with Open Storage. FileMaker Pro is creating the correct file in the location within the usual RC_Data_FMS directory, however when the script runs, it deosn't import anything. The server log is reporting Error 100 which means it isn't able to locate the CSV file, but I can't seem to control where it's looking.

       

      What I would prefer to do is rely on the Server's ability to grab things from the FileMaker Server/Data/Documents directory, but I can't figure out how to compose the external storage to cause the CSV to be put in that location.

       

      I'd be content with the Documents directory and forget about using the TemporaryPath if I could get it to work at all.

       

      The thing about defining those paths in the Storage pane of the field definition is that the path somehow inherits the path that exists on the user's local computer instead of the Server's path to its own Documents folder. In other programming systems, you can use ../ to indicate a hierarchy above the current one, but I can't seem to make that work in FileMaker.

       

      Help?

       

      thanks in advance.

       

      Dennis Burnham