6 Replies Latest reply on Aug 31, 2009 5:36 AM by jbarnum

    Web Viewer Relative URL Challange



      Web Viewer Relative URL Challange

      Your post

      I have a Web Viewer object that I would like to pass a relative URL to. We have environment needs that require that the form is moved from a development to a production environment (different server names) and different forms of access (http vs https).  I would like to avoid the extra step of changing the URL during each deployment.


      For example, the viewer currently is set to the absolute path http://mysite/path/file.html and I would like to have is set to /path/file.html.  However, the viewer automatically appends the http: to the URL and gets confused.


      Does anyone have any suggestions or could propose an acceptable workaround?  Thanks.

        • 1. Re: Web Viewer Relative URL Challange



          Thank you for your post.


          If you want to open a file with your browser, then use "file:///" followed by the path of where the file is located.  For example, "file:///path/file.html"  where "path" includes the name of the public volume.  That way, when you move it to a server, load the public volume and the link will still work.



          FileMaker, Inc. 

          • 2. Re: Web Viewer Relative URL Challange

            Thank-you for your quick reply! 


            I explored your suggestion; however, we have a technical restriction that will prevent the file: URI solution from working.  Our users from home will only be able to access the site via http and will not have access to a shared volume :(


            At this point I am looking at maintaining two different URLs as our best option.  Altough I am wondering if I could embed my own iframe within the form and bypass the Web Viewer control altogether?

            • 3. Re: Web Viewer Relative URL Challange

              Not sure if it could be a good aproach to your problem, something that could help you is to keep alive the web pages what you are using in development phase for the forms, and once you change to the production server you could include autoload javascript in local (could be placed at the server directory) web pages in order to make an automatic redirection to the production form.


              Hope it could help you in some way.




              • 4. Re: Web Viewer Relative URL Challange

                You can use a calculation field for the Web Viewer URL that is based on some field you set in your startup script.


                So your startup script might do something like:

                If( Get(SystemIPAddress) is ...whatever... ) )

                set base URL to "http://yadayada"


                set base URL to "http://heyheyhey"

                End If


                Have a calc field based on base URL, and use that for the Web Viewer. 

                • 5. Re: Web Viewer Relative URL Challange

                  Well it seems that sometimes the best solution is to do nothing at all.  The server guys figured out a way to translate the machine name on the fly (using Microsoft's ISA Server) so that the traffic to the user ends up looking like:


                  www.webaddress.ca\iwp -> myservername\iwp

                  myservername\iwp -> www.webaddress.ca\iwp


                  No code changes required.  Thanks for all of the helpfull suggestions!

                  • 6. Re: Web Viewer Relative URL Challange

                    The Programmer's Creed:


                    "Hard Work Often Pays Off After Time, but Laziness Always Pays Off Now."