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 690 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 Offline
          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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post