• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
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 400 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.
    • S Offline
      Schlicki2808
      last edited by 25 Apr 2022, 14:34

      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?

      L 1 Reply Last reply 26 Apr 2022, 15:14 Reply Quote 0
      • L Online
        lduboeuf @Schlicki2808
        last edited by 26 Apr 2022, 15:14

        @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
        • S Offline
          Schlicki2808
          last edited by 26 May 2022, 15:32

          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
          • S Schlicki2808 marked this topic as a question on 26 May 2022, 15:34
          • S Schlicki2808 has marked this topic as solved on 26 May 2022, 15:34
          • First post
            Last post