2 Replies Latest reply on Dec 18, 2010 11:30 AM by FentonJones

    Exporting Media Field to XML File



      Exporting Media Field to XML File


      Hi @all

      I have a Database in FM10 Pro Advanced and want now to export the content of the Database to an XML File, so that the content of the FM Database can be synced with an App which is running on the iPhone.

      I wanted to start with a simple export export trough the menu to have an XML file to test with. But when I try to export that database as an xml file, I get an error, that media fields cannot be exported. So I guess I'm missing an important point in the export because xml would be a perfect container for data with images.

      So my questions:

      - How can I export data from FM to an XML file with fields containing images ?

      - Is there a way to do the export (with capsulated images) per script only ? If yes, where to start with that ?

      Thanks a lot... But I guess I have overseen something elementary.

      Cheers, Daniel

        • 1. Re: Exporting Media Field to XML File

          Though it may be possible to somehow put the raw image data into xml, all XML I've seen just has a path to the image as a file. It could be a relative image path, in reference to a known path (FileMaker Application folder, your desktop folder, a folder anywhere you can calculate a path to).

          So you would need to export the images as files. Which you may have some things to learn about. But it is not that difficult. Container fields always contain the original name, including its extension of the file. So you just need to prefix that with the path to a folder.You would have that same path in a calculation field in FileMaker, as text. You could then Export XML, sending that path. At the other end, you've got the path, you've got the files.

          Your plain XML export is going to be FileMaker's syntax, which is pretty much different from whatever the iPhone wants. You will need an XSL stylesheet file (which is a just sub-set of the XML language, made to do all kinds of editing to what ends up as the result. So you just take FileMaker's output, pick out the pieces of data you want, and wrap it however the receiving application expects (and can deal with; no one can automatically handle someone elses XML document, if they were not developed to do so). But it is generally not that difficult.

          • 2. Re: Exporting Media Field to XML File

            P.S. You do know about the FileMaker Go application, from FileMaker?