HTML App - file selection
-
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?
-
@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
-
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!
-
-