<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: URL Encoding in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/1230511#M4392</link>
    <description>&lt;P&gt;Hi Stephan - I know this is old but I'm struggling with how to upload camera images to a server.&amp;nbsp; My preference would be to use a custom web service that can consume FormData via HTTPRequest since I then have ultimate control once there (I do this already via JavaScript).&amp;nbsp; The problem is I can't get figure out&amp;nbsp; "FormData" in QT QML.&amp;nbsp; I'm able to use NetworkRequest and can get the data to ArcGIS Online, but don't know what I can do with it once it's there.&lt;BR /&gt;&lt;BR /&gt;Any guidance would be appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2022 16:51:28 GMT</pubDate>
    <dc:creator>PhilPonce</dc:creator>
    <dc:date>2022-11-10T16:51:28Z</dc:date>
    <item>
      <title>URL Encoding</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/804098#M1393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I need to send an image&amp;nbsp;using&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #0055af;"&gt;XMLHttpRequest&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and for that the&amp;nbsp; image data needs to be encoded, in javascript&amp;nbsp; this function &lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL"&gt;FileReader.readAsDataURL()&lt;/A&gt;&amp;nbsp;does this perfectly, but i'm not able to do so using QML.&lt;/P&gt;&lt;P&gt;I'm only able to read the image as binary values like this "\xFF\xD8\xFF....etc"&lt;/P&gt;&lt;P&gt;Could you please let me know how i can achieve this using &lt;STRONG&gt;ArcGIS Runtime Qt SDK QML.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2019 13:11:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/804098#M1393</guid>
      <dc:creator>AbdelrahmanAbdelrazek</dc:creator>
      <dc:date>2019-07-25T13:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: URL Encoding</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/804099#M1394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Runtime API doesn't have any utilities to read images like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding&amp;nbsp;&lt;A href="https://community.esri.com/group/4076"&gt;AppStudio for ArcGIS&lt;/A&gt;‌ to see if they have any suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2019 17:57:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/804099#M1394</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2019-07-25T17:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: URL Encoding</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/804100#M1395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're using AppStudio for ArcGIS, there are several ways for working with images and uploading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. NetworkRequest has built in support for multipart/form-data if it detects a file upload in the request (similar to Unix curl command).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;NetworkRequest &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    id&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; networkRequest
    method&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"POST"&lt;/SPAN&gt;
    url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://some.end.point"&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

networkRequest&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;send&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    f&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"pjson"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
    file&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; networkRequest&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;uploadPrefix &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"myimage.png"&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the best method, because (a) your application logic is simple, (b) the file is not loaded into memory, but streamed in blocks directly from file to the internet, allow one to upload very large files, (c) you needn't worry about setting your headers correctly for a multipart/form-data upload, this is done for you automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. We have File and BinaryData object for reading a file and converting it to another format, e.g. base64 encoding&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:21:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/804100#M1395</guid>
      <dc:creator>StephenQuan1</dc:creator>
      <dc:date>2021-12-12T09:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: URL Encoding</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/804101#M1396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stephen,&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;you mentioned that the NetworkRequest detects a file in the request,&lt;/P&gt;&lt;P&gt;Is this happens because in the body object you added a &lt;STRONG&gt;file&lt;/STRONG&gt; property, if so what if the object is complex and has more properties not only &lt;STRONG&gt;file&lt;/STRONG&gt; and &lt;STRONG&gt;f &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and the property name not file --data instead.&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;f:json,&lt;/P&gt;&lt;P&gt;attachments:{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;adds:[&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data&lt;/STRONG&gt;:networkRequest.uploadPrefix+"myimage.png"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Will the NetworkRequest still going to detect that a file in the request and set the headers to "multipart/form-data"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also i tried to use &lt;STRONG&gt;Binarydata&lt;/STRONG&gt; several times, but no luck till now to convert the image to (URL Encoded format).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the following is example of an image after reading its data as URL encoded format, and this allows me to send it using&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #0055af; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;XMLHttpRequest&amp;nbsp; &lt;/SPAN&gt;and &lt;SPAN style="color: #0055af; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;NetworkRequest&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAHFJREFUWIXt1jsKgDAQRdF7xY25cpcWC60kioI6Fm/ahHBCMh+BRmGMnAgEWnvPpzK8dvrFCCCAcoD8og4c5Lr6WB3Q3l1TBwLYPuF3YS1gn1HphgEEEABcKERrGy0E3B0HFJg7C1N/f/kTBBBA+Vi+AMkgFEvBPD17AAAAAElFTkSuQmCC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you copy and paste the previous value on the browser, an image will be shown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know if there is a way that allows me to convert the image data into that format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2019 16:07:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/804101#M1396</guid>
      <dc:creator>AbdelrahmanAbdelrazek</dc:creator>
      <dc:date>2019-07-26T16:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: URL Encoding</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/1230511#M4392</link>
      <description>&lt;P&gt;Hi Stephan - I know this is old but I'm struggling with how to upload camera images to a server.&amp;nbsp; My preference would be to use a custom web service that can consume FormData via HTTPRequest since I then have ultimate control once there (I do this already via JavaScript).&amp;nbsp; The problem is I can't get figure out&amp;nbsp; "FormData" in QT QML.&amp;nbsp; I'm able to use NetworkRequest and can get the data to ArcGIS Online, but don't know what I can do with it once it's there.&lt;BR /&gt;&lt;BR /&gt;Any guidance would be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 16:51:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/url-encoding/m-p/1230511#M4392</guid>
      <dc:creator>PhilPonce</dc:creator>
      <dc:date>2022-11-10T16:51:28Z</dc:date>
    </item>
  </channel>
</rss>

