3 Replies Latest reply on May 1, 2017 5:41 PM by rouelf

    Web Viewer Not Displaying from TempPath

    rouelf

      Am stump, until a few weeks ago this script used to work in OS X. Today is not working. But still works in FM Go. Checked other FM files that use this technique, and they also don’t work in OS X.

      Using FMA 15.0.3.305, obviously something has changed. How can I get it to work ??

       

      The Web Address looks like this:  file://Macintosh HD/var/folders/k5/n2kb9v_s7md4x_t4skct8fjc0000gn/T/S10/Pink Minnie Mouse.jpg

       

      Message: The requested URL was not found on this server.

       

       

      If [ OpenDirectory::File WebView = "View Import" ]

           Set Variable [ $$fileURL; Value:"file:" & Get ( TemporaryPath ) & GetContainerAttribute ( OpenDirectory::Import Container ; "filename" ) ]

           Export Field Contents [ OpenDirectory::Import Container; “$$fileURL” ]

           Set Variable [ $$fileURL; Value:Substitute ( $$fileURL ; "file:" ; "file:/" ) ]

           Set Field [ OpenDirectory::WebViewer; $$fileURL ]
           Set Web Viewer [ Object Name: "FileView"; Action: Reset ]

      Else If [ OpenDirectory::File WebView = "View Export" ]
           Set Variable [ $$fileURL; Value:"file:" & Get ( TemporaryPath ) & GetContainerAttribute ( OpenDirectory::Export Container ; "filename" ) ]

           Export Field Contents [ OpenDirectory::Export Container; “$$fileURL” ]

           Set Variable [ $$fileURL; Value:Substitute ( $$fileURL ; "file:" ; "file:/" ) ]

           Set Field [ OpenDirectory::WebViewer; $$fileURL ]
           Set Web Viewer [ Object Name: "FileView"; Action: Reset ]

      End If

       

        • 1. Re: Web Viewer Not Displaying from TempPath
          Johan Hedman

          Your Temp folder is unique for each time you start FMP15v3. When you quit, it is then deleted

          • 2. Re: Web Viewer Not Displaying from TempPath
            user14047

            See Web Viewer, OSX10.12.4 The local path pattern is no longer valid. Why?

            sam_oda wrote:

            This arises from OSX10.12.4 Webkit, not FileMaker. So we have to take a workarounds from the followings.
            1. "file:/" to "file:/volumes"
            2. Substitute VolumeName to "private"
            3. skip the volumeName
            4. change the volume name to the name which doen't include space
            5. use the plugin / custom function

            file:///Macintosh HD/var/folders/lt/xxxxx  → file:///var/folders/lt/xxxxx

            1 of 1 people found this helpful
            • 3. Re: Web Viewer Not Displaying from TempPath
              rouelf

              Thanks, so removing ( substitute: Macintosh HD with nothing ) does the trick:

               

              If [ OpenDirectory::File WebView = "View Import" ]

                   Set Variable [ $$fileURL; Value:"file:" & Get ( TemporaryPath ) & GetContainerAttribute ( OpenDirectory::Import Container ; "filename" ) ]

                     Export Field Contents [ OpenDirectory::Import Container; “$$fileURL” ]
                    Set Variable [ $$fileURL; Value:Substitute ( $$fileURL ; "file:" ; "file:/" ) ]
                    Set Variable [ $$fileURL; Value:Substitute ( $$fileURL ; "Macintosh HD" ; "" ) ]

                     Set Field [ OpenDirectory::WebViewer; $$fileURL ]
                     Set Web Viewer [ Object Name: "FileView"; Action: Reset ]

              Else If [ OpenDirectory::File WebView = "View Export" ]
                  Set Variable [ $$fileURL; Value:"file:" & Get ( TemporaryPath ) & GetContainerAttribute ( OpenDirectory::Export Container ; "filename" ) ]
                   Export Field Contents [ OpenDirectory::Export Container; “$$fileURL” ]
                   Set Variable [ $$fileURL; Value:Substitute ( $$fileURL ; "file:" ; "file:/" ) ]
                   Set Variable [ $$fileURL; Value:Substitute ( $$fileURL ; "Macintosh HD" ; "" ) ]

                Set Field [ OpenDirectory::WebViewer; $$fileURL ]
                Set Web Viewer [ Object Name: "FileView"; Action: Reset ]

              End If