8 Replies Latest reply on Jun 18, 2014 2:55 PM by dtvconsult

    WebDirect Exprot Field Contents

    bigtom

      I read the bulletin about WD and Safri. That is not the issue here. I am testing with OSX and Firefox.

       

      This works fine with Get(DesktopPath) & "/image/" & tablename::fieldname & "-1.jpg" in OSX but I have one user that insists on running a PC over WebDirect. The following script is doing some odd stuff with WD. There are a series of containers (12) that may contain images. The script checks each container individually and exports the contents.

       

      I understand there is a failure of WD to export files sequentially as detailed here. If the record only has five images it will generate a popup for only the fifth image as expected. However, the .jpg is not being added. For example if the prpending field value is 2034 I get a file "2034-5" and not "2034-5.jpg". It the "." a reserved character? When I add the file extension to the file manually it shows as an image and all is fine, but that is not the workflow anyone is looking for.

       

      If [not IsEmpty (tablename::image_1)]

      Set Variable [$path;

      Choose ( Abs ( Get ( SystemPlatform ) ) -1 ;

       

      /*MAC OS X*/

      Get(DesktopPath) & "/image/" & tablename::fieldname & "-1.jpg"

      ;

      /*WINDOWS*/

      "filewin:"& Get(DesktopPath) & "/image/" & tablename::fieldname & "-1.jpg"

      )]

      Export Field Contents [tablename::image_1; "$path"]

      End If

       

       

      If [not IsEmpty (tablename::image_2)]

      Set Variable [$path;

      Choose ( Abs ( Get ( SystemPlatform ) ) -1 ;

       

      /*MAC OS X*/

      Get(DesktopPath) & "/image/" & tablename::fieldname & "-2.jpg"

      ;

      /*WINDOWS*/

      "filewin:"& Get(DesktopPath) & "/image/" & tablename::fieldname & "-2.jpg"

      )]

      Export Field Contents [tablename::image_2; "$path"]

      End If

       

       

      Get(DesktopPath) is not supposed to be supported but it seemed to find the correct path for the file anyway.

       

      So, how can I make this more friendly?

       

      Obviously I need a script that will determine WD before the FMP scripts get to going. If (Get ( SystemPlatform )=4) Perform a different script.

       

      I am stumped with finding a good way to export the files sequentially via WD and keep the proper extension and get to the proper path.

        • 1. Re: WebDirect Exprot Field Contents
          mikebeargie

          The first thing to do would be to change things so they do not run sequentially.

           

          Things I would try (completely thinking off the top of my head):

           

          1) Run the export actions in a subscript inside of a loop in the parent script, making sure to have an exit script step at the end of the subscript.

           

          2) Add a pause script step between the two exports

           

          3) add an export records script step to export a dummy record to the temporary location between each export.

           

          This seems like it's a bug that will be corrected in a future version. In the meantime, you just need to find the "Reset" mechanism that will allow for multiple exports.

           

          Please keep us apprised of your progress.

          • 2. Re: WebDirect Exprot Field Contents
            bigtom

            Mike I was eyeballing somehting close to what you said. I will give it a go and keep you posted.

             

            The user was convinced to use FMP for now.

            • 3. Re: WebDirect Exprot Field Contents
              beverly

              images use "imagewin:" not "filewin:". Look at the dialog when trying to import an image.fm_filepath_images_dialog.jpg

              • 4. Re: WebDirect Exprot Field Contents
                user19752

                Get(DesktopPath) ends with "/" so use "image/" instead of "/image/"

                 

                Your $path is empty when run on WEBD.

                Downloading on WEBD, the path to save is controled by browser preferences and the user, so setting only filename is enough.

                • 5. Re: WebDirect Exprot Field Contents
                  dtvconsult

                  I'm having a similar problem.  I have a layout that I use to store documents for users to download.  There are various file types.  I'm using the "Export Field Contents" script step to download the desired document to the user's desktop. I'm also using the Get(DesktopPath) and a field containing the file name to designate the output file name.

                   

                  This works correctly if the user is using a FileMaker Pro 13 client.  If the user is accessing the page using WebDirect:

                   

                  1. The file downloads to the user's desktop.

                  2. The file name does match the desired file name EXCEPT there is no extension.

                   

                  The extension designating the file type has been striped from the file.

                   

                  We have tested this on Mac OS v10.9.3 with FileMaker Pro 13.0v3 using various browsers (Safari 7.0.4, Firefox v28, Chrome v35.0.1916.153) with the same results.

                   

                  Why would WebDirect just strip out the extension?

                   

                  BTW:  If you add the proper extension to the downloaded file manually, the file opens correctly.

                  • 6. Re: WebDirect Exprot Field Contents
                    bigtom

                    The extension issue is actually the biggest problem that I cannot work around or solve in any other way than having the user manually ener the extension. Again users think FileMaker is broken. I do not know why Filemaker does not take the issues that cause users to think it is a broken or inferior product seriously. The problems that are beyond the developer and part of how the software operates.

                    • 7. Re: WebDirect Exprot Field Contents
                      user19752

                      I had mistake on my test, and found work around.

                      Simply add one more extension for WEBD like

                      tablename::fieldname & "-2.jpg" & ".jpg"

                       

                      (One thing is that I used a 'GIF' file and use extension .jpg, then Safari changed it as .gif...)

                      • 8. Re: WebDirect Exprot Field Contents
                        dtvconsult

                        I tried your work around and it works for me as well.

                         

                        I detect a Web user and then copy the extension and add it back on.  FMPro clients are unaffected.

                         

                        Thanks.  This will get my project back on track until FM fixes the problem.