<?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: Upload KML file to portal in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569901#M53132</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this to work I would need to host the KML/KMZ file on a webserver and then use.&lt;/P&gt;&lt;P&gt;In my case I have the files in my local machine, so I would like to upload them to the portal content and then use them.&lt;/P&gt;&lt;P&gt;The issue is I am unable to upload them to the portal content via code (which otherwise works if I use the portal Add Items option)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Jan 2015 13:20:49 GMT</pubDate>
    <dc:creator>PramodHarithsa1</dc:creator>
    <dc:date>2015-01-05T13:20:49Z</dc:date>
    <item>
      <title>Upload KML file to portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569896#M53127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am trying to upload a KML file to portal using the AddItem rest service.&lt;/P&gt;&lt;P&gt;I have tried to replicate things from the upload shape file example &lt;A href="https://developers.arcgis.com/javascript/jssamples/portal_addshapefile.html" title="https://developers.arcgis.com/javascript/jssamples/portal_addshapefile.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Add shapefile | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;P&gt;my code looks like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var formId=dom.byId("KMLFile");
var item={
'type':'KML',
'title':'MyKMLFile',
'f':'json',
'callback.html':'textarea'
{;
var requestHandle=esri.request({
&lt;SPAN&gt;url:"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://domain.com/portal/sharing/rest/content/users/username/addItem" rel="nofollow noopener noreferrer" target="_blank"&gt;https://domain.com/portal/sharing/rest/content/users/username/addItem&lt;/A&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;
handleAs:"json",
content:"item",
form:formId,
load:this.success,
error:this.failure
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a success message and itemID but the file is not getting uploaded. Please let me know if I am missing something. Thanks.&lt;/P&gt;&lt;P&gt;Pramod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:32:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569896#M53127</guid>
      <dc:creator>PramodHarithsa1</dc:creator>
      <dc:date>2021-12-12T00:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Upload KML file to portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569897#M53128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you use the KML in Portal?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks that you just upload and share KML via the poratl.&amp;nbsp; Is it correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, have you verified your KML file via the &lt;SPAN class="uicontrol"&gt;Add Item&lt;/SPAN&gt; button on the &lt;SPAN class="uicontrol"&gt;My Content&lt;/SPAN&gt; page, before coding?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also add the KML by referencing the&amp;nbsp; URL of a .kml or .kmz file &lt;A _jive_internal="true" class="xref" href="https://community.esri.com/en/arcgis-online/share-maps/add-items.htm#ESRI_SECTION1_1A21D51E1AFC41EA9974209BD94E50C0"&gt; as an item from the web&lt;/A&gt; to test if your KML works with your portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls update us.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 09:49:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569897#M53128</guid>
      <dc:creator>larryzhang</dc:creator>
      <dc:date>2015-01-05T09:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Upload KML file to portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569898#M53129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/9126"&gt;larry zhang&lt;/A&gt;‌&lt;/P&gt;&lt;DIV class="j-author-act font-color-meta-light"&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;Yes it is just to upload and share. I have verified the KML file via the Add Item button. It works fine there.&lt;/P&gt;&lt;P&gt;I have also verified via the link I am trying to use: &lt;A href="https://domain.com/portal/sharing/rest/content/users/username/addItem" title="https://domain.com/portal/sharing/rest/content/users/username/addItem"&gt;https://domain.com/portal/sharing/rest/content/users/username/addItem&lt;/A&gt;&lt;/P&gt;&lt;P&gt;everything works except thro' the code!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 11:53:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569898#M53129</guid>
      <dc:creator>PramodHarithsa1</dc:creator>
      <dc:date>2015-01-05T11:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Upload KML file to portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569899#M53130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I mentioned in my other post KML works fine when I try with the usual upload option.&lt;/P&gt;&lt;P&gt;The idea here is to upload the KML to portal and generate the URL so that the same can be shared across.&lt;/P&gt;&lt;P&gt;As KML can be added to the map only through a web server, we are using the item URL's to add them to the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any hint on the code to upload them to portal?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 12:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569899#M53130</guid>
      <dc:creator>PramodHarithsa1</dc:creator>
      <dc:date>2015-01-05T12:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Upload KML file to portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569900#M53131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On your description here, it looks that you plan to share the layer via KML, rather than 'Add KML and then share'...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, please refer to &lt;A href="https://developers.arcgis.com/javascript/jssamples/layers_kml.html" title="https://developers.arcgis.com/javascript/jssamples/layers_kml.html"&gt;KML | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="KML_layer.PNG" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/47525_KML_layer.PNG" style="width: 620px; height: 318px;" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 12:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569900#M53131</guid>
      <dc:creator>larryzhang</dc:creator>
      <dc:date>2015-01-05T12:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Upload KML file to portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569901#M53132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this to work I would need to host the KML/KMZ file on a webserver and then use.&lt;/P&gt;&lt;P&gt;In my case I have the files in my local machine, so I would like to upload them to the portal content and then use them.&lt;/P&gt;&lt;P&gt;The issue is I am unable to upload them to the portal content via code (which otherwise works if I use the portal Add Items option)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 13:20:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569901#M53132</guid>
      <dc:creator>PramodHarithsa1</dc:creator>
      <dc:date>2015-01-05T13:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Upload KML file to portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569902#M53133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;Via JavaScript codes, to upload files like KML to the web, pls refer to &lt;A href="http://blog.teamtreehouse.com/uploading-files-ajax"&gt;http://blog.teamtreehouse.com/uploading-files-ajax&lt;/A&gt;&lt;BR /&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;++++++++++++++&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;As you know, ESRI alredy offers many easy ways (ArcGIS Online, ArcGIS Explorer…) to upload KML files to ArcGIS Online or Portal for sharing. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 10:34:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569902#M53133</guid>
      <dc:creator>larryzhang</dc:creator>
      <dc:date>2015-01-06T10:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Upload KML file to portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569903#M53134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks larry for the reply.&lt;/P&gt;&lt;P&gt;I am aware of the file upload option with ajax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was just trying to work with the portal rest api to do the same. (which should be very much possible)&lt;/P&gt;&lt;P&gt;Any hints on how to upload kml file using the addItem rest api: &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000008q000000" title="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000008q000000"&gt;ArcGIS REST API&lt;/A&gt; &lt;BR /&gt;I have tried something like this: &lt;A href="http://gis.stackexchange.com/questions/42959/how-to-add-item-to-the-arcgis-portal-with-the-portal-api" title="http://gis.stackexchange.com/questions/42959/how-to-add-item-to-the-arcgis-portal-with-the-portal-api"&gt;How to add item to the ArcGIS Portal with the portal API? - Geographic Information Systems Stack Exchange&lt;/A&gt; but have found no luck in getting the file on portal. (although the item gets added with size 0 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pramod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 06:25:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569903#M53134</guid>
      <dc:creator>PramodHarithsa1</dc:creator>
      <dc:date>2015-01-07T06:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Upload KML file to portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569904#M53135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Pramod,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also having a similar issue while uploading JSON files to my arcgisonline account. Did you figure out the issue ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 09:53:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upload-kml-file-to-portal/m-p/569904#M53135</guid>
      <dc:creator>HumzaAkhtar</dc:creator>
      <dc:date>2015-08-03T09:53:50Z</dc:date>
    </item>
  </channel>
</rss>

