4 Replies Latest reply on Dec 17, 2012 2:28 AM by steve.winter

    Scripting text export for web access




      I have a FM-file with Bible verses from which I want to get one verse a day for a web page. I use FMSA11 on OS Server 10.6.8. I made a FM-script to choose and export the text and I succeeded to write it by a server side script into Library/FileMaker Server/Data/Documents/ but not to Library/WebServer/Documents, where I could get it by web link. I have tried different settings of privileges for the folder.


      How can I set permissions to be able to write to the web server from FM server? The path set in the script is filemac:/Server HD/Library/WebServer/Documents/text.html.


      Thanks for help,

      Ola Österbacka

      OF system, FBA-member

      Vaasa, Finland

        • 1. Re: Scripting text export for web access

          Hi there


          No matter what permissions you give the /Library/WebServer/Documents folder FMS won't be able to write to there. What you'll need to do is to create a shell script which does the copy for you, then have the FMS scheduler run that script just after the FM script which exports.


          So, FileMaker writes out to /Library/FileMaker Server/Data/Documents, then a shell script, e.g.

               cp -f /Library/FileMaker Server/Data/Documents/verse.html /Library/WebServer/Documents/verse.html

          can be scheduled to run a few min later, to copy the file across (the -f flag forces a replace without prompt)


          Save this line as a script in  /Library/FileMaker Server/Data/Scripts with a name like copyVerse.sh


          In the FMS console select to create a schedule, to run a script, and select System-level script. Select the name from the drop down, then in the Account to Run the System-level Script section, provide username/password for a user who has read access on the FM Documents folder and write permissions on the WebServer Documents folder.


          Hope this makes sense and solves your problem for you





          Steve Winter

          Matatiro Solutions Limited


          p:  +44 23 8064 4181

          m: +44 77 7852 4776

          USA: +1 415 315 9912

          2a St. Mary's Road

          Bishopstoke SO50 6BP


          Registered in England and Wales: 6300320

          Registered Office: 44 Southchurch Road, Southend, SS1 2LZ

          VAT Registration Number: 916 8809 86

          IMPORTANT: This message is private and confidential. If you have received this message in error, please notify us and remove it from your system.

          • 2. Re: Scripting text export for web access

            Since you have FMS, I think a much better way is to write a little PHP page using the FM PHP API and that extracts your bible verse  and directly displays it.

            • 3. Re: Scripting text export for web access

              Thank you very much, Steve, for a quick and detailed answer! I followed your advice and succeeded in copying in the Terminal, but not as a server side script. The info was "Aborted by user", so I suppose I would have to change privileges in sudoers file (admin help). But that is not what I'm used to do, so I think I try the method proposed later by MartinBraendle - thanks to you, too!



              • 4. Re: Scripting text export for web access

                Martin's idea is a much better solution to the problem - I was simply providing a solution to your question as asked