Hi All,
I am trying to upload a KML file to portal using the AddItem rest service.
I have tried to replicate things from the upload shape file example Add shapefile | ArcGIS API for JavaScript
my code looks like,
var formId=dom.byId("KMLFile");
var item={
'type':'KML',
'title':'MyKMLFile',
'f':'json',
'callback.html':'textarea'
{;
var requestHandle=esri.request({
url:"https://domain.com/portal/sharing/rest/content/users/username/addItem",
handleAs:"json",
content:"item",
form:formId,
load:this.success,
error:this.failure
});
I get a success message and itemID but the file is not getting uploaded. Please let me know if I am missing something. Thanks.
Pramod