We have been seeing a number of reports that indicate there is considerable confusion about the new server side import and export capabilities of FileMaker® Server 10 and FileMaker® Server 10 Advanced. We want to assist developers by clarifying how this new feature is supposed to work.
First and foremost, there are only 2 folders that FileMaker Server can use to export to or import from:
1. the Documents Folder in the root level of FileMaker Server.
2. A temporary folder created (and deleted) for the instance of the script schedule
This apparent limitation addresses permissions issues in the privileges bubble in which FileMaker Server runs. The account that runs FileMaker Server has access to those folders but not necessarily others.
The import/export path cannot be dynamic when using the export or import feature on the server. The temp path gets generated for each script session so it will vary from schedule to schedule. On Windows that path looks something like this:
C:/WINDOWS/Temp/S43
The name of the subfolder is specific for the running script schedule and is deleted when the schedule ends.
If you want to use a location that persists, your only option here is to put the file in the FileMaker Server Documents Folder and import from there or export to there.
Here is an example of an export. Given a file with a table alias City with fields Country and City, and a layout named Test, the following construct will produce an exported file called testfile.txt when it is run server side. The file will be sorted by Country, then by City, will contain all records for the table, and will be a tab delimited text file. The script:
Go to Layout [“Test” (City)] Show All Records Sort Records [Specified Sort order: City::Country; ascending City::City; ascending} [Restore; No Dialog] Set Variable [$varpath; Value: “filewin:” & Get(DocumentsPath) & “testfile.txt”] Export Records [File Name: “$varpath”; Character Set “Windows (ANSI); Field Order: City::Country City::City] [No dialog]Note again that the Get(DocumentsPath) when run server-side resolves to the Documents Folder in the root level of FileMaker Server. FileMaker Server has permissions to read from and to write to that directory. It may well not have permissions to read from or to write to other directories on the server machine. Similarly the Get(TemporaryPath) when run server-side will resolve to the temporary subfolder created for the running script schedule.
Thus, developers wishing to use server side exports or imports must channel those actions through FileMaker Server’s Documents Folder or the Temporary folder. Also note that the script above requires no user action through the User Interface. The Go to Layout step is used to set the correct context based on the table alias from the Relationship Graph attached to the layout. The layout does not have to have any fields placed on it.
We hope this explanation clarifies what is happening with this feature and that it helps developers utilize this important new feature correctly.
Wim and Steven
This post has been promoted to an article




This topic is locked



























