9 Replies Latest reply on Jul 14, 2015 7:58 AM by BorisKamp

    External container fields exporting error

    BorisKamp

      Title

      External container fields exporting error

      Post

      Hi guys!

      Here's my table layout https://www.dropbox.com/s/jsen6gxxzgmyzy5/Screenshot%202015-06-09%2010.03.00.png?dl=0

       

      The three AWF tables each have two container fields inside with room for a pdf document.

      I have a button with this specified script step to view the document:

      Set variable step with name: '$Path' and value: `Let`:

      Let ([filename=GetAsText(AWF1::Deelnameformulier)];
      Get (TemporaryPath) & Right(filename; Length(filename)-
      Position (filename;"/";Length(filename);-1)))

      In the same script I have set Export Field Contents:

      [AWF1::Deelnameformulier; "$path"; Automatically open]

      I have this script three times, each fund has it's own with AWF1, AWF2 and AWF1.

      The scripts work for in each table except the AWF3 table, the AWF table gives me a error:

      the file "FILENAME" could not be opened, it may be damaged or use a file format that Preview doesn't recognize.

      Wierd thing is, when I insert a pdf in the AWF3 table container, it creates three files in my external set storage: .pdf, .jpeg and .png.

      when I insert a pdf in the AWF1 or AWF 2 table container, it creates two files in my external set storage: .pdf, .jpeg (no png!?)

      what wrong here? I recently updated from FM12 to FM13

       

      Thanks!

       

        • 1. Re: External container fields exporting error
          BorisKamp

          Anybody who has any idea on what's causing this??

          • 2. Re: External container fields exporting error
            BorisKamp

            I did some testing and found out the problem exists only when I drag a pdf to the container field on OS X.:

                   
            1. It adds the .pdf file to the external storage
            2.      
            3. it adds a .png file of the .pdf file to the external storage
            4.      
            5. it adds a .jpg file of the .pdf file to the external storage

            When I use 'insert file' to insert a pdf to the container, it works perfectly and only adds the .pdf file to the external storage. 

            On windows computers both drag and drop and 'insert file' work the same, perfectly.

            So how can we fix the drag and drop on Mac computers??

            Thanks!

            • 3. Re: External container fields exporting error
              philmodjunk

              I have an idea that may help you diagnose this:

              Define an unstored calculation field with this expression:

              Getastext ( yourContainerfieldHere )

              Put this calculation field right next to your container field and size it large enough to see multiple lines of text. Now test your various methods of inserting files and on both platforms. Look at the actual file path data returned in this calculation field and see if you can spot what difference in the text might be resulting in an invalid file path or file name.

              • 4. Re: External container fields exporting error
                BorisKamp

                Thanks Phil!

                Did what you said and here are the results.

                For a correct working document:

                remote:NADG - 15712 Coyle - Promissory Note and Mortgage.pdf

                FILE:Purchase Documents/NADG - 15712 Coyle - Promissory Note and Mortgage_1.pdf

                 For a document that cannot export:

                remote:NADG - 19964 Packard - Promissory Note and Mortgage.pdf

                size:608,788

                JPEG:Purchase Documents/NADG - 19964 Packard - Promissory Note and Mortgage.jpg

                PDF :Purchase Documents/NADG - 19964 Packard - Promissory Note and Mortgage.pdf

                PNGf:Purchase Documents/NADG - 19964 Packard - Promissory Note and Mortgage.png

                Note the extra info with the second! I don't even want FM to make a jpg or png, any clues?

                 

                Thanks! 

                • 5. Re: External container fields exporting error
                  BorisKamp

                  Anybody any clues on what's going on here?

                  If you need more info from my side I'll happily provide it asap!

                  Thanks!

                  • 6. Re: External container fields exporting error
                    philmodjunk

                    I've never seen the text from a container field look like that. Usually, the .png and .jpg references are to thumbnails, but I've not seen them listed in the container field like that.

                    If you are using FileMaker 13 or later. Try using GetContainerAttribute to extract the file name and see what you get.

                    • 7. Re: External container fields exporting error
                      BorisKamp

                      Thanks for the reply, using this:

                      GetContainerAttribute ( PurchaseDocuments::Document; "filename" )

                      gets me this result:

                      TW - Allen Pointe Dr 9964 Unit 47 - Buy HUD both sigs.pdf

                      Seems pretty normal right?

                      My existing calculation for the $path variable in my export field contents script is this:

                      Let ([filename=GetAsText(PurchaseDocuments::Document)];
                      Get (TemporaryPath) & Right(filename; Length(filename)-
                      Position (filename;"/";Length(filename);-1)))

                      Note the GetAsText, should I replace this with the GetContainerAttribute?

                      *EDIT

                      I did as I suggested and it works flawlessly again! Thanks Phil! noteworthy to know that the GetAsText does not work in my situation, I might not be the only one!

                       

                      Thanks!

                      • 8. Re: External container fields exporting error
                        philmodjunk

                        I suggested GetAsText as a way to see what data is actually in the container field as a way to see why your calculation was not succeeding in extracting a file name. The aim would have been to adjust the calculation in order to correct extract the file name, not to use getastext to get the file name.

                        But when your thread popped back up, I recalled that there is now an easier way to get file names from container fields and thus suggested that approach. I was also curious to see if the filename returned was for a PDF or a different file type. wink

                        • 9. Re: External container fields exporting error
                          BorisKamp

                          Hi Phil,

                          Sorry, I meant to aim at my original script that used GetAsText, I recall I found the code for that script somewhere on these forums. it worked previously but with FM13+ it's not working anymore.

                          So if you encounter anything similar here in the future, you know what the issue is (-: Guess I won't be the only one using that script.

                          Thanks for fixing this Phil!