2 Replies Latest reply on Dec 11, 2012 10:09 PM by sk*419893*er

    download file in mobile application

      It's understood that setting up a download link from a custom table is accomplished via the following -
      [from http://docs.oracle.com/cd/E14373_01/appdev.32/e13363/up_dn_files.htm#CIHBFCDH ]

      Create Download Page for Embedded PL/SQL Gateway
      The Oracle XML DB HTTP Server with the embedded PL/SQL Gateway is typically used for Application Express in Oracle Database 11g. Calling a PL/SQL procedure directly from a URL that is not known in a list of allowed procedures, as shown in Change the Download Link to Use the New Procedure, results in an error message.

      To avoid this situation, there are a couple of available options. The first option is to modify the PL/SQL function WWV_FLOW_EPG_INCLUDE_MOD_LOCAL to include the PL/SQL download_my_file procedure and then recompile. The second, described below, is to create a page in the application that has a before header branch to the PL/SQL download_my_file procedure. You then create a hidden item on that page for the document ID of the document to be downloaded.

      I have been using the great new tools in 4.2 to create mobile applications with much success on a platform. However, when I set up a download page as prescribed, the result on my Samsung Galaxy S3 is not user-friendly on either Firefox or the Google browser. When the user clicks on a download link, the result is a blank page with the word "undefined". If the user reloads the page, then a message appears briefly "Starting download..." If the user then opens the "pull down menu" the download appears in the Notifications section. So it works, but it's not intuitive or even easy to figure out what happened.

      Does anyone have any knowledge of this? Is there some way to control the message on the "undefined" page? Is there a way to cause the smartphone to automatically open the file?

      Thanks all!

        • 1. Re: download file in mobile application
          Marc Sewtz-Oracle
          Hi Bill,

          This could potentially be an issue with jQuery Moble's AJAX navigation. By default, jQuery Mobile loads pages via AJAX to allow for smooth page transitions. This means that instead of doing a full page load for the next page, jQuery Mobile loads that page into the DOM of the current page and then replaces the content via JavaSript.

          Since APEX 4.2 is using jQuery Mobile for the mobile templates, the same is true of APEX pages that you navigate to from a mobile page, as well as links to other content, such as your file download. One way to circumvent this would be to defined you links as: "javascript:location.href=([your link]);" instead of just a plain link. Depending on your specific implementation, there are also other jQuery Mobile settings that would allow for having link targets not be loaded via AJAX. Take a look at rel="external" and data-ajax="false" in the jQuery Mobile documentation, and see what might apply to your scenario:


          • 2. Re: download file in mobile application
            Hi Marc,
            Perfect. I redefined the link with your javascript reference and it worked like a charm. I think this should be added into the developer manual. The ApEx community is awesome!

            Best regards,