<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Upload Button for images in Web app]]></title><description><![CDATA[<p dir="auto">Dear all,<br />
in the web app I'm developing the user is supposed to upload an image via a input element:</p>
<pre><code>&lt;label for="file"&gt;Upload&lt;/label&gt;
&lt;input type="file"  accept="image/*" name="image" id="file"  onchange="loadFile(event)"&gt;
</code></pre>
<p dir="auto">This then prompts the JS function</p>
<pre><code>var loadFile = function(event) {
  var image = document.getElementById('pic');
  image.src = URL.createObjectURL(event.target.files[0]);
};

</code></pre>
<p dir="auto">This works in all the browsers on my ubuntu desktop but not  in the app itself on my phone. This screen opens, when I click the 'upload button'</p>
<p dir="auto"><img src="/assets/uploads/files/1607627811487-errorubtouch.jpg" alt="errorUBtouch.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Any idea what the problem is here would be much appreciated...</p>
]]></description><link>https://forums.ubports.com/topic/5281/upload-button-for-images-in-web-app</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 23:53:16 GMT</lastBuildDate><atom:link href="https://forums.ubports.com/topic/5281.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Dec 2020 19:18:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Upload Button for images in Web app on Sat, 12 Dec 2020 17:17:40 GMT]]></title><description><![CDATA[<p dir="auto">I have solved the problem. The issues had nothing to do with my code. Just in case it helps anyone else: In the file</p>
<p dir="auto">yourappname.apparmor</p>
<p dir="auto">(which is automatically generated by clickable) you need to add the policy group "picture_files_read". I assumed   "content_exchange" would suffice but it doesn't. So this issue is solved</p>
]]></description><link>https://forums.ubports.com/post/43630</link><guid isPermaLink="true">https://forums.ubports.com/post/43630</guid><dc:creator><![CDATA[lmh]]></dc:creator><pubDate>Sat, 12 Dec 2020 17:17:40 GMT</pubDate></item><item><title><![CDATA[Reply to Upload Button for images in Web app on Fri, 11 Dec 2020 11:58:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kugiigi" aria-label="Profile: kugiigi">@<bdi>kugiigi</bdi></a> Thanks for the links. Will have a look at it tonight. I am coding in html/css/js and using clickable to create the ubuntu touch package/app. I think I found another solution here</p>
<p dir="auto"><a href="https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications" rel="nofollow ugc">https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications</a></p>
]]></description><link>https://forums.ubports.com/post/43590</link><guid isPermaLink="true">https://forums.ubports.com/post/43590</guid><dc:creator><![CDATA[lmh]]></dc:creator><pubDate>Fri, 11 Dec 2020 11:58:31 GMT</pubDate></item><item><title><![CDATA[Reply to Upload Button for images in Web app on Fri, 11 Dec 2020 03:47:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lmh" aria-label="Profile: lmh">@<bdi>lmh</bdi></a> How are you creating the webapp? Are you embedding a webview in QML?<br />
If yes, you can check <a href="https://github.com/kugiigi/pesbuk-app/blob/89c75d28330c956e2aada21bc5cbbe9b5cf2016a/pesbuk/WebViewPage.qml#L381" rel="nofollow ugc">here</a>. Content hub implementation is in <a href="https://github.com/kugiigi/pesbuk-app/blob/master/pesbuk/ContentPickerDialog.qml" rel="nofollow ugc">here</a>.</p>
]]></description><link>https://forums.ubports.com/post/43578</link><guid isPermaLink="true">https://forums.ubports.com/post/43578</guid><dc:creator><![CDATA[kugiigi]]></dc:creator><pubDate>Fri, 11 Dec 2020 03:47:47 GMT</pubDate></item></channel></rss>