7 Replies Latest reply on Jun 10, 2011 2:30 AM by Anitram

    Server Side Export cannot write file

    Anitram

      Title

      Server Side Export cannot write file

      Your post

      Hello

      I have a problem with the export on the FM Server. On the client the script work's fine, but on the server, the file cannot be written. And I have no idea why.

      Set Variable [$DocPath; Value:"filewin:" & Get(DocumentsPath) & "/test.csv"]
      Export Records [No dialog; "$DocPath"; Windows (ANSI)]

      Get(DocumentsPath) returns /C:/Program Files (x86)/FileMaker/FileMaker Server/Data/Documents/ and no error arises, errorcode is 0! The log file shows also no error!

      What's wrong?

      Thanks
      Martina    

        • 1. Re: Server Side Export cannot write file

          Anitram:

          Thanks for posting!

          It appears that your script is correct (the / before test.csv is unnecessary but my testing indicated it won't cause an issue). When you say it doesn't return an error, can you confirm that you're looking at the logs in the Log Viewer for this information? When you setup the server side script, it should have prompted you for a username and password. Did the account you used have permission to export?

          TSBear
          FileMaker, Inc. 

          • 2. Re: Server Side Export cannot write file
            Anitram

            Hello TSBear

            Thanks for your answer!

            For testing I do the following (in prosa, I'm not in the office at time):

            error notification on
            goto layout (table contains one record)
            set variable $DocPath
            Export records $DocPath
            set variable $Error; get(LastErrorCode);
            send E-Mail to me with info of $DocPath and $Error

            $DocPath =  filewin:/C:/Program Files (x86)/FileMaker/FileMaker Server/Data/Documents/test.csv

            $Error = 0

            Then I check the FM Server Log in directory "FileMaker Server\Log"

            The entries are:
            script started
            script running
            script ready

            Nothing about an error!

            The account I used have permission to export. I tested it with two different accounts.

            When I running the same script from remote, it works!

            Do you have any idea which I still could test?

            Thanks
            Martina

            • 3. Re: Server Side Export cannot write file

              Anitram:

              The filewin: part of the path you've set, while unnecessary in this circumstance, shouldn't cause an issue. The / immediately following it, however, will cause a failure. Try changing your file path to the following and let us know if it still fails:

              Get(DocumentsPath) & "test.csv"

              TSBear
              FileMaker, Inc. 

              • 4. Re: Server Side Export cannot write file
                Anitram

                Hello TSBear

                I tested with:

                "filewin:" & Get(DocumentsPath) & "test.csv"
                "file:" & Get(DocumentsPath) & "test.csv"
                Get(DocumentsPath) & "test.csv"

                Result always the same:
                Remote works
                Server script not

                Thanks
                Martina

                 

                • 5. Re: Server Side Export cannot write file

                  Anitram:

                  Let's create a brand new database with a few records and one script:

                  Set Variable[$filePath;Get(DocumentsPath) & "test.csv"]
                  Export Records[No dialog; "$filePath"; Windows(ANSI)]

                  Then, upload this file to the server and create a new schedule to run this script. This should tell us if we need to continue looking at the script or if we should be looking at something more on an OS level.

                  TSBear
                  FileMaker, Inc. 

                  • 6. Re: Server Side Export cannot write file
                    Anitram

                    Hello TSBear

                    OK, I will do so!

                    I'am back to office at friday.

                    Also, you hear from me friday.

                    Many thanks for your great help
                    Martina

                    • 7. Re: Server Side Export cannot write file
                      Anitram

                      Hello TSBear

                      The test with the new database was successfully!

                      The problem was an extern table in the database, with a wrong path that only works on the client but not on the server.

                      That probably prevented any export.

                      Thanks for your help
                      Martina