<?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: custom widget - How can javascript download from url of zipped shapefile into my 3D Scene, with minimum manual operations? in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-how-can-javascript-download-from-url/m-p/791508#M4183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume it is impossible in WAB to import directly from url of zipped shapefile(s) into my scene.&lt;/P&gt;&lt;P&gt;So I had to download the zip into my PC,&amp;nbsp;and I developed custom widget to import from zip file in my PC into my 3D scene.&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Sep 2020 06:36:13 GMT</pubDate>
    <dc:creator>MichaelLev</dc:creator>
    <dc:date>2020-09-10T06:36:13Z</dc:date>
    <item>
      <title>custom widget - How can javascript download from url of zipped shapefile into my 3D Scene, with minimum manual operations?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-how-can-javascript-download-from-url/m-p/791507#M4182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; padding: 0px;"&gt;&lt;SPAN class="" dir="ltr"&gt;I adapted the code in&lt;SPAN&gt; &lt;A href="https://playground.fmeserver.com/javascript/server-uploads/upload-file-in-session/"&gt;FME Server Playground - Upload File In Session&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" dir="ltr"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" dir="ltr"&gt;into my ESRI Web AppBuilder custom-widget javascript code,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" dir="ltr"&gt;and after uploading input file to my FME cloud and running the cloud workspace, all by javascript alone, the returned json has the &lt;STRONG&gt;url&lt;/STRONG&gt; of the result &lt;STRONG&gt;zipped&amp;nbsp;shapefile&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; padding: 0px;"&gt;&lt;SPAN class="" dir="ltr"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; padding: 0px;"&gt;&lt;SPAN class="" dir="ltr"&gt;Now I want to import the zipped shapefile into my 3D scene, with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: bold; text-decoration: none;"&gt;&lt;STRONG&gt;&lt;SPAN class="" dir="ltr" style="text-decoration: underline;"&gt;minimum&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="" dir="ltr"&gt;manual user operations, but mainly by the javascript code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; padding: 0px;"&gt;&lt;SPAN class="" dir="ltr"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; padding: 0px;"&gt;&lt;SPAN class="" dir="ltr"&gt;My questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL style="color: #16325c; background-color: #ffffff; padding: 0px 2rem;"&gt;&lt;LI&gt;&lt;SPAN class="" dir="ltr"&gt;Can I import the url directly to my scene?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="" dir="ltr"&gt;Is there some "magic" javascript code to download it by my web application without displaying explorer download dialog to the user? And that my javascript will know the downloaded path? Perhaps by "&lt;STRONG&gt;fetch&lt;/STRONG&gt;" (which I am not familiar to)? If yes, how?&lt;/SPAN&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Next code snippet displays an explorer download dialog to the user, but how can I set a promise to know &lt;STRONG&gt;WHEN&lt;/STRONG&gt; the user finished? either by cancelling or approving the download, and what is the final path and name of the downloaded zip, since the user can change things in the explorer download dialog? and since I don't know how to "connect" to the explorer download dialog box?&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="" style="color: #005fb2;"&gt;&amp;nbsp; &amp;nbsp; let&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000;"&gt; a &lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000;"&gt; document&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000;"&gt;createElement&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #04844b;"&gt;"a"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;EM&gt;&lt;SPAN class="" style="color: #000000;"&gt;&amp;nbsp; &amp;nbsp; a&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000;"&gt;style &lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #04844b;"&gt;"display: none"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;EM&gt;&lt;SPAN class="" style="color: #000000;"&gt;&amp;nbsp; &amp;nbsp; a&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000;"&gt;href &lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000;"&gt; obj&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000;"&gt;zipUrl&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;;&lt;/SPAN&gt;&lt;/EM&gt;&lt;EM&gt;&lt;SPAN class="" style="color: #000000;"&gt;a&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000;"&gt;click&lt;/SPAN&gt;&lt;SPAN class="" style="color: #8f6d4d;"&gt;();&lt;/SPAN&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;After&amp;nbsp;my widget javascript code&amp;nbsp;has the path to the ziped shapefile in the PC, since it's my first time of doing such thing - I will appreciate to get links/code examples &lt;STRONG&gt;how to import it into the Scene&lt;/STRONG&gt;. I now learning the example in&amp;nbsp;&lt;SPAN style="color: #ff6600;"&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-shapefile/index.html"&gt;Create a FeatureLayer from a shapefile&lt;/A&gt;&lt;/SPAN&gt;, but are there preferred documents/links or code examples to learn from?&lt;/LI&gt;&lt;/OL&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; padding: 0px;"&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; padding: 0px;"&gt;&lt;SPAN class="" dir="ltr"&gt;I'll greatly appreciate help how to do it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; padding: 0px;"&gt;&lt;SPAN class="" dir="ltr"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; padding: 0px;"&gt;&lt;SPAN class="" dir="ltr"&gt;Michael&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2020 11:32:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-how-can-javascript-download-from-url/m-p/791507#M4182</guid>
      <dc:creator>MichaelLev</dc:creator>
      <dc:date>2020-08-13T11:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: custom widget - How can javascript download from url of zipped shapefile into my 3D Scene, with minimum manual operations?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-how-can-javascript-download-from-url/m-p/791508#M4183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume it is impossible in WAB to import directly from url of zipped shapefile(s) into my scene.&lt;/P&gt;&lt;P&gt;So I had to download the zip into my PC,&amp;nbsp;and I developed custom widget to import from zip file in my PC into my 3D scene.&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2020 06:36:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-how-can-javascript-download-from-url/m-p/791508#M4183</guid>
      <dc:creator>MichaelLev</dc:creator>
      <dc:date>2020-09-10T06:36:13Z</dc:date>
    </item>
  </channel>
</rss>

