6 Replies Latest reply on Mar 18, 2016 7:03 PM by beverly

    Remote containers and xml

    sprosser

      I'm working with a client's web development company to create a set of CWP pages for searching their database. I'm passing familiar with HTML, and can use/edit somebody else's PHP when necessary. But this company is using XML, and I'm as likely to win a gold medal in ice dancing as I am to read that code. Everything's working just fine except access to remote container data. But the XML coder has never worked with FileMaker before and can't get any variation of the default base directory to work.


      One final piece of background info— I'm calculating a path using a combination of ExecuteSQL (the Logo file is one of several placed for each record) and UTF-8 encoding (my client is getting file names that include spaces). At first the coder was tweaking the path in his code using a calculated file name I provided, but then he asked for a full relative path in the calc.


      FWIW, WebDirect can find/show the images from their default base directory ( Files/My Database/Documents/...) with no problem. As a test, I manually moved a few images to:

       

         /Library/FileMaker Server/HTTPServer/htdocs

       

      where they appear for me when I type the following into my browser:

       

         MY.IP.ADD.RSS/filename.jpg

       

      Is this the canonical path? Am I stuck manually moving the files when the users place them? I don't want to change the path for the remote containers since the ones that should be available on the web are a small subset of all graphics the client is placing in FileMaker. I've considered creating a separate table and process for storing these files. But that seems confusing for users, at least, so I'm not loving this idea.

       

      Is there a standard path that should work for the XML guy? What do you CWP experts recommend?

        • 1. Re: Remote containers and xml
          beverly

          Ms. S! Some paths need to be absolute (full path as the computer sees it) and some can be relative. In the case of Web-served documents (of all kinds) it's usually relative to the root of the web server and/or the site/domain directly that is being accessed based on the DNS (domain name system/servers) pointers. "/htdocs" is a common web root directory and you may not be able to "list" the contents directly.

           

          So permissions on the directory are a big factor. A directory above a web root may be preferable for config-type files, as the normal user cannot get to them with any URL (relative path, likely), but PHP (for example) can with an absolute path.

           

          Your mission (should you choose to accept!) is to see what web application is being used and how file paths can be defined as "legal". And to see how directory permissions come to play.

           

          Ms. B!

          • 2. Re: Remote containers and xml
            sprosser

            Thanks for the lifeline Bev! Some of this is like ice dancing to me, but let me rephrase what you’re saying to make sure I’m skating on the right rink. Feel free to talk to me as you would a small child with a short attention span.

             

            I did try listing several folder contents, as a test. I couldn’t view any of them, but I was only typing into the browser, not writing any kind of well-formed page.

             

            All the folders and files in both paths (FileMaker Server and OS Library/htdocs) have read/write fmadmin privileges. Do I need to create a new server group for the web? And can I make them read only for safety?

             

            I’ll pass your full message along to the developer and see if it triggers something from him. Maybe at least he can send me a sample absolute path from his web application.

            • 3. Re: Remote containers and xml
              user19752

              I suspect you are using FMS13 (since 14 don't have XML cwp)

              here is document https://fmhelp.filemaker.com/docs/13/en/fms13_cwp_xml.pdf

              and the syntax for getting container data is written as

               

              For example:

              http://www.company.com/fmi/xml/cnt/data.jpg?-db=products&-lay=sales

              &-field=product_image(1)&-recid=2

              • 4. Re: Remote containers and xml
                beverly

                (since 14 don't have XML cwp)

                 

                What? the API for PHP uses XML, the direct query (with any web app) uses XML.

                There is no XML/XSLT web publishing. But other than through xDBC, the custom web publishing uses XML.

                 

                Can you clarify?

                beverly

                • 5. Re: Remote containers and xml
                  user19752

                  It was my guess as OP said only "but this company is using XML" and nothing about the language (other than HTML nor PHP) which use xml data, so it may be XSLT.

                   

                  Anyway FM14 seems using same syntax for getting container.

                  https://fmhelp.filemaker.com/docs/14/en/fms14_cwp_guide.pdf

                  • 6. Re: Remote containers and xml
                    beverly

                    Thanks! But not FMP Server with XML/XSLT. Even PHP can transform xml with xslt.

                     

                    beverly