UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    HTML App - file selection

    Scheduled Pinned Locked Moved Solved App Development
    3 Posts 2 Posters 396 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • Schlicki2808S Offline
        Schlicki2808
        last edited by

        I am currently developing a Ubuntu Touch App and I'm using the HTML template. I do not use any libraries or dependencies, but pure HTML + JavaScript. I've tried the following to allow the user to pick a file on the device:

        <input type="file" accept="image/*">
        <input type="file" accept="*">
        

        Both tags lead to a window with the following message (in clickable desktop as well as on the device):

        Sorry, there aren't currently any apps installed that can provide this type of content.

        In the clickable log I've also noticed the following message:

        file:///usr/share/morph-browser/ContentPickerDialog.qml:118: ReferenceError: acceptTypes is not defined
        (I'm not sure if this message has something todo with my problem)

        How can I enable the file selection?

        lduboeufL 1 Reply Last reply Reply Quote 0
        • lduboeufL Online
          lduboeuf @Schlicki2808
          last edited by

          @schlicki2808 hello, never worked on html apps on UT, but files access is done with ContentHub.

          There is a raw documentation here: https://api-docs.ubports.com/sdk/apps/html5/ContentHub/ContentHub.html

          1 Reply Last reply Reply Quote 0
          • Schlicki2808S Offline
            Schlicki2808
            last edited by

            I found the solution! I came across the documentation for the policy groups. So I added "content_exchange" to the list of the "policy-groups" in the apparmor file and - voila - the input file dialog shows me a list of apps.

            Thanks for the hint with the Content Hub!

            1 Reply Last reply Reply Quote 3
            • Schlicki2808S Schlicki2808 marked this topic as a question on
            • Schlicki2808S Schlicki2808 has marked this topic as solved on
            • First post
              Last post