Hi,
Very thanks for all your help
The problem is I don`t understand the code from https://community.esri.com/thread/203227-upload-kml-file-programmatically#comment-720547 it is first time I do something like this.
In the page your share there is next code (I think I would be use just this part):
// user is a portalUser.
// fileList is an array of files.
// tags is an array of strings
function addFileaAsPortalItem(user, fileList, tags){
const file = fileList[0];
let form = new FormData();
form.append('file',file);
form.append("f", "json");
form.append("title", file.name);
form.append("name", file.name);
form.append("type",'KML');
form.append("token", <server token>);
form.append("filename", file.name);
form.append("tags", tags.join());
return esriRequest(`${user.userContentUrl}/addItem`,{
method: 'post',
query: form
});
}
What it is portal User ?
If portal user is:
https://www.arcgis.com/sharing/rest/content/users/****/items
What it is *****? my Temporary access token??, my Subscription ID??
What tags are?
should I create this function and It will be work?
Sorry for my javascript level and thanks again for your help