user442096
user442096

Reputation:

Exporting XML from FIleMaker Pro Server

FileMaker Pro 10 Server: Mac OS X Server 10.4.11
DAtA Server: Windows Server 2008

I am having problem cross platform issue when exporting XML from FileMaker Pro client on a Mac to DATA Server.

My FileMaker Pro server is hosting on a Mac OS X and the I need user to export their data to a DATA server which is hosting on a Windows Server. I created a button(function/script) in the FileMaker form for user to export data once they finish with their job. FileMaker Pro client on the PC works perfectly but It does't work on the MAC. I've tried every combination I can think of for the location path as documented on: http://www.filemaker.com/11help/html/create_db.8.32.html#1030283

Any idea?
Thanks

Upvotes: 0

Views: 1314

Answers (1)

Mikhail Edoshin
Mikhail Edoshin

Reputation: 2669

FileMaker client runs under different OS privileges than FileMaker Server. The client has the same privileges as the current user, while the server runs as fmserver:fmsadmin and can only access its own directory tree in /Library/FileMaker Server.

Try to write a separate server script and export into the following file:

"filemac:" & Get( DocumentsPath ) & "myfile.xml"

This should export the file into /Library/FileMaker Server/Data/Documents. If this works, then the script is OK and you only need to work around the privileges issue. I think there are two paths to try:

  1. Try to give FileMaker correct privileges for the target folder. I'm not quite sure this will work for a Windows folder. But if it worked, then the path will be like this:

    • On Mac all FileMaker paths virtually start in /Volumes.
    • You start the path with a platform prefix: filemac:.
    • E.g. to point to /my/path on disk My Disk you'll write:

      filemac:/My Disk/my/path
      
  2. Export into the Documents folder and rewrite the schedule to run shell script after this. Give this shell script another privilege set and have it to move the file to the desired directory.

UPDATE: To initiate the process on client and have it to save the file on server you need to somehow tell the server that there's a file it needs to save. I'd suggest something like this:

  • Create a “File” table with a container field. Set up a server script that runs, say, every five minutes, checks if there are any new records in this table, exports each record using the Export Field Contents script step, and deletes the record. (Or marks it as completed plus replaces the stored file with a reference; whatever suits you.)
  • Or do the same, but instead of running a server script have a FileMaker client on the same machine that runs a script every five minutes. This one is easier to debug and it can move the file elsewhere.
  • Or do the same as the first time, but instead of waiting use the Import XML script step to send a GET request to the server that triggers the script. The request will be like that:

    server/fmi/xml/FMPXMLRESULT.xml&-db=MyDB&-lay=MyLay&-script=MyScript&-findany
    

    This should trigger the script immediately. I don't remember the exact syntax and there will be authentication issues, so please check the CWP web publishing guide.

  • Or do the same (a record in the “File” table or a direct GET request) but have the server to generate the file.

Upvotes: 1

Related Questions