9 Replies Latest reply on May 5, 2016 11:04 AM by Charlesdh

    Imaging

    Charlesdh

      Hi,

       

      Thanks too those who helped me before. But, I still need help for a solution to my problem.

      All of my attempts have failed. Even with the suggestions I received.

      What I'm trying to do is "Link" images to a "Product".

      The Product Name is like this "19DH2437 1234" the Image is also named the same except it has a ".png".

      In my testing I entered the "Product Name with the ".png".

      Ie: "19DH2347 1234.png"

      The Image does not show when I enter the example above.

      I have the container set as  "Secured" location set to  \\Mac\Home\Documents\Images\

      In my example I did not import the images folder. I'm hoping someone can look at my file to see if it's correct.

      The image box for the "Product" I used  "Portal".

       

       

      Thanks

      Charles

        • 1. Re: Imaging
          Charlesdh

          Hi,

           

          I receive this error when I try to "Transfer".

          Example 1: Warning

          2011-07-20 16:27:58.676 +0800   Warning   [Record ID 3, field Animals::Picture] Skipped non-transferrable data: File reference or text.

          Problem: File references and text cannot be transferred.

          Solution: For file references, create a script that embeds the referenced files, then transfer data.

           

          It appears that I need a "Script". But, can I make a change for the Image name so that it can be transferred.

          If not can someone tell me how to create the "Script"?

           

          Thanks

          • 2. Re: Imaging
            Mike_Mitchell

            Based on the error message, you're making one (or both) of two mistakes:

             

            1) You're storing the path to the image, instead of the image, in the container field (unlikely).

             

            2) You're attempting to use external container management by reference. This isn't possible. External container management works only if the asset is embedded in the database.

             

            If you want to use your defined path to store the asset, don't attempt to use externally managed containers. FileMaker will create the necessary directory structure to store the asset, which won't include your path - it'll be one FileMaker manages. (Hence the name "externally managed containers".)  

             

            If you want to control the path yourself, then use either storage by reference, or a Web Viewer object and HTML code to direct FileMaker to display it.

             

            HTH

             

            Mike

            • 3. Re: Imaging
              Charlesdh

              Mike,

               

              Thanks for the reply.

              What do you mean by "storage by reference?" and external container ref.

              As you can see I'm new at this.

              If possible can you provide steps as to how I should create my file?

              I've had help on this and followed their example but my attempt failed.

              Hope this is not asking too much.

              In the mean time I'll do some more research on this.

               

              Thanks

              Charles

              • 4. Re: Imaging
                Mike_Mitchell

                I think you need to define your goal first. Do you want to control the image path yourself, or do you want to let FileMaker do it?

                 

                The answer to that question will depend greatly on the intended use. Are you using FileMaker Server? How many users? Is this a shared network drive, or just on your local computer?

                 

                Storage by reference happens when you import the asset into the container field. There's a checkbox that says "Store only a reference to the file". If it's checked, then you're using referential storage. If not, then you've embedded the asset in the database. Each approach has pluses and minuses.

                 

                Storing by reference allows you to avoid clogging the database with large files. This is sometimes a good option if (a) you want to manage where the assets are stored yourself, and (b) it's either single-user, or all users have guaranteed access to the same network drive (and the same drive mapping, if applicable). Otherwise, the users may not all be able to see the asset. Also, if you ever move or delete the asset, then FileMaker will lose track of it.

                 

                Embedding the asset means you store the entire file inside the database. This makes the solution vastly more portable (since everything's in one file), and means any user who has access to the database (and that table / field) can see it. Naturally, there's a price in larger file size and sometimes stability.

                 

                Externally managed containers combine some of the best features of both worlds. They avoid storing the asset inside the database, but since FileMaker manages the paths to the assets, any user can see them. The downside? You can never, ever, ever touch the external assets through the OS. You risk damaging the connection between the database and FileMaker. All asset management has to take place through the FileMaker database if you use this option. Additionally, you must use the "embed" option for externally managed containers to work properly.

                 

                So ... what is your actual goal?

                • 5. Re: Imaging
                  Charlesdh

                  Mike,

                   

                  Thanks.

                  Currently the Files and Images are on my hard drive.

                  When things are working it will be on a shared network.(Future)

                  It will be stored by reference.(I believe we can delete and add images as necessary)

                  There will be multiple users.( In the field for product sales)

                  I know I have a lot of work ahead. But, as mentioned I'm having problems with the attached file.

                   

                  So my first goal is to be able to attach the image with the product.

                  Then once I can get this part done I'll move on to my next "Improvement".

                   

                  Thanks

                  Charles

                  • 6. Re: Imaging
                    danielfarnan

                    Charles,

                     

                    I read your answer as "this is how I want to do it" and Mike has been trying to find out why you want to do it that way. This sort of background information really helps map out your needs so that you don't get advised to try a solution that achieves your first tactical goal but does not allow you to achieve your strategic goals.

                     

                    The thoughts that come to my mind are:

                     

                    1. Why is it going to be on a shared network once things are working?

                    2. How will users be accessing the shared data? Through FileMaker Pro? Go? WebDirect? The Operating System?

                    3. Is more than one application going to be referencing this data? That is, do you have FileMaker Server hosting the shared database and you want the images available to it AND (for example) a web server so that it can directly reference the image files?

                     

                    Now that I have read your other posted questions I understand a little more, and I think you need to be aware of a few little gotchas that often trip up people new to FileMaker.

                     

                    1. Don't share files using the operating system. The reason for this is that FileMaker is constantly writing to the open database files, and if an operating system operation occurs during this process, BAD THINGS happen. Databases are assumed to be in use all the time, documents (such as Excel files) are assumed to be opened, worked on in memory and then saved back to disk.

                     

                    My recommendation is to avoid your plan of putting this file on a shared network drive. If it needs to be shared, share it using the FileMaker Pro application or (much better) FileMaker Server.

                     

                    2. File references require every user's machine to be able to evaluate the full path to gain access to the referenced file. Read Mike's explanation above (response 4) about why external container storage is a good idea when multiple users are involved.

                     

                    3. Excel rows equate to FileMaker records; Excel columns equate to FileMaker fields. Just as you would set up a spreadsheet with a column for the ID and a column for the image name and then enter data on multiple rows, you would create a FileMaker table with a field for the ID and a field for the image name and then enter data into multiple records.

                     

                     

                    On to some possible solutions:

                     

                    If the Image file has a name that matches the Product Name (but with the .png file extension) and they are all in the same directory then you can set up a calculation field to evaluate the filepath for each record. Is there only ever one image for a given product? Then you can store everything in the Product table. But if there is the slightest chance that there will be more than one image for a product, you need to set up an images table and then a relationship between the two tables.

                     

                    I think that, as per some of the answers given to your other questions, importing images from a folder is the way to go here. The ImageAttempt.fmp12 file you posted is a good enough structure because it has both a Product table and an ImageAttempt table. However, you will need to turn OFF external storage for the Image field.

                     

                    Navigate to the ImageAttempt layout and execute the Import Records -> Folder... command from the File menu. Specify the folder location and DESELECT the option to "Import only a reference to each picture file" - this will import a copy of each image into the database file, which makes it bigger but also makes it self-contained.

                     

                    You will then see the import field matching dialog box:

                    Screen Shot 2016-05-04 at 2.28.28 PM.png

                    Change it so it looks like this:

                    Screen Shot 2016-05-04 at 2.29.54 PM.png

                    (you do that by dragging the Image field in the Target list using the double-headed vertical arrow until it is in the same row as the Image field in the Source list, then click on the horizontal grey arrow next to the File Path field in the Source list).

                     

                    Then import the records, turning ON the auto-enter options so that the ImageId field will populate.

                     

                    You will now have all your images stored in the ImageAttempt table. Scroll through the records to make sure they're showing up OK.

                     

                    I'm assuming that you already have (or know how to get) your product list into the Product table. All that is left to do is remove the file extension (.png) from the values in the ImageName field in the ImageAttempt table:

                    Click in the ImageName field.

                    From the Records Menu, select Replace Field Contents...

                    In the dialog that appears, select the Replace with calculated result option

                    Enter a formula of Left ( ImageName ; Length ( ImageName ) - 4 ) and click OK

                    Click the Replace button and wait for processing to complete. Note that the Replace button is not the default (highlighted) button.

                     

                     

                    Whew! That took longer than I expected! But you should now have the images showing correctly. I've attached an updated copy of your file so you can see how I've done it, but please ask further questions if you need to.

                    • 7. Re: Imaging
                      Mike_Mitchell

                      To add to Daniel's advice, I would stay away from sharing the database using a shared drive. This is the #1 cause of file corruption I see. Here's why:

                       

                      When you open a FileMaker database not hosted by FileMaker Server, your computer becomes the host - in effect, like a little mini-server. All traffic to and from the database file has to pass through your computer. Any changes to the database have to move "over the wire" to the actual database. That's where the problem comes in: If there's any interruption of network or power at either end during a record commit transaction, you can damage the database.

                       

                      If you plan to have multiple users, I strongly recommend you use FileMaker Server. And that, once you get there, you use externally managed containers. Like Daniel said, you shouldn't ever touch the files outside of FileMaker when you do this (because it will break the connection), I use secure storage to prevent any monkey business (people thinking they can just grab the asset and go elsewhere with it.

                       

                      If you want to put the assets up on a web server, for example, then you can use a Web Viewer object to access them. It sounds like you want to be able to manipulate the assets through the OS, so this might be a better approach.

                      • 8. Re: Imaging
                        Charlesdh

                        Mike and Daniel,

                         

                        Thanks very much for your help.

                        I accomplished what you suggested.

                        I was asked weather or not my Images will have more than 1 Image. Yes some will.

                        I have a code that will populate the first Image.

                        To do so I used to fields.

                        "Product" and "VT". Product is for the Name of the product. And "VT" is for the Image.

                        If there is a second Image it will be as "VT1". This may be changed for better identification.

                        So my next step will be to get the second Image to Populate if required.

                         

                        Once again! Thanks for all your help. Also thanks for the help I received from bigtom and the other members.

                         

                        Charles

                         

                         

                         

                         

                         

                        • 9. Re: Imaging
                          Charlesdh

                          HI,

                           

                          I tried to add a "New" product. When entered the "Image" for it was not displayed.

                          With the way my file is configured will I need to do another "Import"?

                          Or, should it populate the "Image"?

                           

                          Thanks

                          Charles