I moved the conversation to the right forum: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/re-display-of-kml-file-in-esri-ja...
Sorry for the inconveniences.
@Vinay_Kumar please provide more info. You are writing the the ArcGIS REST JS forum, are you using this technology? This is mainly to access ArcGIS REST/web services.
What is the File Object? Is it the KML? It is hosted in ArcGIS?
Please share as much information as you can (to help us to help you) 😉.
Like User will upload the KML file we need to display on the ArcGIS REST JS Map. It was not hosted in ArcGIS. Is there an alternative without hosting?
I think you are talking about the ArcGIS Maps SDK for JS and not ArcGIS REST JS, are you?
If that's the case, the Maps SDK which is for client-side applications (UI) with maps have a KMLLayer class you can use to load data from an external source.
I moved the conversation to the right forum: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/re-display-of-kml-file-in-esri-ja...
Sorry for the inconveniences.