<?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 uploading file from webAppBuilder web app to portal geoprocessing service, fails on error 403 in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/uploading-file-from-webappbuilder-web-app-to/m-p/1137811#M14683</link>
    <description>&lt;P&gt;I use WebAppBuilder 2.22 to develop 3D web apps (esri js API 4.22) with custom widgets for our portal.&lt;/P&gt;&lt;P&gt;I published geoprocessing service to our portal and I need to give it an input file.&lt;/P&gt;&lt;P&gt;I used esri/request to upload the input file to the proper url in order to be used by the geoprocessing service, but the upload failed. I think the upload url is correct -&lt;/P&gt;&lt;P&gt;https://&amp;lt;serverDomain&amp;gt;/arcgis/rest/services/&amp;lt;geoprocessingService&amp;gt;/GPServer/uploads/upload&lt;/P&gt;&lt;P&gt;but I get error 403 (that means that the authentication is OK, but there is no permission)&lt;/P&gt;&lt;P&gt;What should I do?&lt;/P&gt;&lt;P&gt;Help will be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 10:28:27 GMT</pubDate>
    <dc:creator>MichaelLev</dc:creator>
    <dc:date>2022-01-27T10:28:27Z</dc:date>
    <item>
      <title>uploading file from webAppBuilder web app to portal geoprocessing service, fails on error 403</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/uploading-file-from-webappbuilder-web-app-to/m-p/1137811#M14683</link>
      <description>&lt;P&gt;I use WebAppBuilder 2.22 to develop 3D web apps (esri js API 4.22) with custom widgets for our portal.&lt;/P&gt;&lt;P&gt;I published geoprocessing service to our portal and I need to give it an input file.&lt;/P&gt;&lt;P&gt;I used esri/request to upload the input file to the proper url in order to be used by the geoprocessing service, but the upload failed. I think the upload url is correct -&lt;/P&gt;&lt;P&gt;https://&amp;lt;serverDomain&amp;gt;/arcgis/rest/services/&amp;lt;geoprocessingService&amp;gt;/GPServer/uploads/upload&lt;/P&gt;&lt;P&gt;but I get error 403 (that means that the authentication is OK, but there is no permission)&lt;/P&gt;&lt;P&gt;What should I do?&lt;/P&gt;&lt;P&gt;Help will be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 10:28:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/uploading-file-from-webappbuilder-web-app-to/m-p/1137811#M14683</guid>
      <dc:creator>MichaelLev</dc:creator>
      <dc:date>2022-01-27T10:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: uploading file from webAppBuilder web app to portal geoprocessing service, fails on error 403</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/uploading-file-from-webappbuilder-web-app-to/m-p/1137881#M14684</link>
      <description>&lt;P&gt;Indeed, js API 4.* has a bug and it does not upload smoothly as js API 3.*,&lt;/P&gt;&lt;P&gt;but I found a solution, based on&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-javascript-questions/using-js-api-4-9-and-esrirequest-to-upload-a-kml/td-p/584182" target="_blank" rel="noopener"&gt;Using JS API 4.9 and esriRequest to upload a KML file to a geoprocessing service&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added a second special &amp;lt;input&amp;gt; in the form, then upload succeeded and returned json.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The html form looks like&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&amp;lt;form data-dojo-attach-point="uploadForm"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; enctype="multipart/form-data"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; method="POST"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dir="ltr"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data-dojo-type="dijit/form/Form"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;id="widget-gpcad2shp2-uploadForm"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;input type="file" name="file" multiple="false"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; accept=".dwg"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; id="widget-gpcad2shp2-input"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; class="inputfile"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; title="my title"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data-dojo-attach-point="inputFile"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;hidden /&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;label for="widget-gpcad2shp2-input"&amp;gt;${nls.btn.inputFile.chooseFile}&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;span id="widget-gpcad2shp2-file-chosen"&amp;gt;${nls.btn.inputFile.noFileChosen}&amp;lt;/span&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;!-- extra input needed. see &lt;A href="https://community.esri.com/t5/arcgis-api-for-javascript-questions/using-js-api-4-9-and-esrirequest-to-upload-a-kml/td-p/584182" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-javascript-questions/using-js-api-4-9-and-esrirequest-to-upload-a-kml/td-p/584182&lt;/A&gt; --&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;input type="hidden" name="f" value="json" /&amp;gt;&lt;BR /&gt;&amp;lt;/form&amp;gt;&lt;BR /&gt;&amp;lt;span class="file-upload-status" style="opacity:1;"&lt;BR /&gt;data-dojo-attach-point="uploadStatus"&amp;gt;&amp;lt;/span&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and the js upload call looks like:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;var options = {//any of the 3 ways will work. For the last 2, you have to add&amp;nbsp;'dojo/dom' in the define at top&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; //body: document.getElementById("widget-gpcad2shp2-uploadForm"),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; //body: dom.byId("widget-gpcad2shp2-uploadForm"),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; body: that.uploadForm.domNode,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; method: "post",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; responseType: "json"&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;esriRequest( that.fileUploadedUrl, options)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .then(that.successHandler, that.errorHandler);&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 15:06:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/uploading-file-from-webappbuilder-web-app-to/m-p/1137881#M14684</guid>
      <dc:creator>MichaelLev</dc:creator>
      <dc:date>2022-01-27T15:06:14Z</dc:date>
    </item>
  </channel>
</rss>

