9 Replies Latest reply on Oct 30, 2011 1:14 AM by Corné

    view images from hard disk in layout



      view images from hard disk in layout


      hi everyone, I'm new to FM and as far as I have learned the software is very powerful and useful. My situation is the following, I hope someone can help me:

      I have a DB for flower varieties, the main information for each variety is stored in a master table wich has the code, the name, the color, etc. I designed a layout where you can see all the information concerning a specific variety, and I would like to have the possibility to see the picture of the variety in this layout; the picture is a jpg file I have stored in a folder of my hard disk, each picture has the same name of the unique code of each variety, that is if the variety code is B490, the picture filed is called B490.jpg.

      The DB at present has more than 7000 records (and of course I have the same number of jpg pictures stored on the hard disk; now the first question is: how do I tell FM to look on a specific route of my hard disk and seek for the jpg file to show it on the layout, in the corresponding field?

      How do I import all the current references to the more than 7000 pictures?

      How do I repeat this process every time I add a record to the DB, since it is a dynamic DB that increases everytime I get new varieties on my catalogue.

      I hope someone can help me, thank you very much in advance.

        • 1. Re: view images from hard disk in layout


          since your pictures are all in the same folder and has the Code as the name, it is easy to do.

          Create a new field in your table, that must be a calculation, return type container.

          let's say your pictures are located in C:\pictures\
          your calculation will be :

          "C:\pictures\" & table::Code & ".jpg"

          put this field on your layout and it will display the image.


          • 2. Re: view images from hard disk in layout

            oups I forgot something,

            in the calculation you must put imagewin: or imagemac: in front of the path.

            Example if you are on windows :

            "imagewin:c:\pictures\" & table::code & ".jpg"

            • 3. Re: view images from hard disk in layout

              Hi Mystic, thanks a lot for your help, I did what you suggested but I still get an error message "the specified field is not found" when I add the calculation field:

              "imagewin:F:\Users\Sandra\Pictures\Fotos\Variedades Clavel\Redimensionadas\"&MAESTRA::CODIGO&".jpg"

              any idea of what I am doing wrong?

              Thanks in advance

              • 4. Re: view images from hard disk in layout

                Try this:

                "imagewin:/F:/Users/Sandra/Pictures/Fotos/Variedades Clavel/Redimensionadas/" & MAESTRA::CODIGO & ".jpg"



                • 5. Re: view images from hard disk in layout

                  To explain why Nick's suggestion should work, the backslash \ functions as an "escape" character in FileMaker text expressions. You can, for example, use it like this \" to put get FileMaker to treat a double quote as a character instead of the marker for the end of some literal text in an expression. You can use \ in your file path, but you have to double them everywhere you use them, so the / becomes an easier option to use.


                  "imagewin:F:\\Users\\Sandra\\Pictures\\Fotos\\Variedades Clavel\\Redimensionadas\\"&MAESTRA::CODIGO&".jpg"

                  Should also work.

                  • 6. Re: view images from hard disk in layout

                    OK, thanks to both of you for your answers, here is what I get now:

                    Using PhilModJunk's suggestion I am able to configure the field with the calculation formula, now I go  to the layout and try to display the field but I get the following  message: File not found:F:\Users\Sandra\Pictures\Fotos\Variedades Clavel\Redimensionadas\D 308 M.jpg

                    using Nick's suggestion: I am able to configure the field with the  calculation formula, now I go to the layout and try to display the field  but I get the following message:File not found:D 308 M.jpg

                    In both cases I have already checked that the file D 308 M.jpg is present on the folder related so the file DOES exist; and this happens with every record and every file, the system is not able to display any picture.

                    Any suggestions will be highly appreciated, thanks a lot for your help.

                    • 7. Re: view images from hard disk in layout

                      Let's try this experiment to see if we can narrow down what detail is at issue here.

                      Take a container field in a blank record--this can be a container field in your current file or you can simply create a new file and use it for this test.

                      Use Insert Picture to insert the above image file into the container with the "by reference" option selected.

                      Define a calculation field that returns text and put the name of your container field as the sole term in the caluclation field's expression. (In other words, if the Container field is named ContainerField, just put ContainerField in the specify Calculation dialog box.)

                      Put this new field on the layout next to your container field and size it so that it is several lines of text tall. In browse mode, you should see several lines of text here and one line of text should be the FileMaker format file path to your image. Compare it letter by letter to the expression you've been using to see if you can determine what detail is different.

                      • 8. Re: view images from hard disk in layout

                        Thanks PhilModJunk, I did what you suggested and here is what I get now:

                        image:../../../Pictures/Fotos/Variedades Clavel/Redimensionadas/D 308 M.jpg
                        imagewin:/F:/Users/Sandra/Pictures/Fotos/Variedades Clavel/Redimensionadas/D 308 M.jpg

                        so I went inmediately and added the slash before the drive letter F and VOILA!!! it worked perfectly!! Thank you really really so much, you saved me lots of work. I hope this is useful for someone else as well.

                        Thanks again, great forum!

                        • 9. Re: view images from hard disk in layout

                          Hello all,

                          My question is similar to Sandra's, which I cannot figure out yet: I would like to extend this question with viewing files from a webserver. If I can view an image in my webbrowser at address http://www.yyy.com/images/image.jpg How can I make this image viewable in FMP? Thanks in advance!