AnsweredAssumed Answered

How to add shapefile on basemap without open file dialog

Question asked by mgambone2 on Jan 6, 2015
Latest reply on Jan 6, 2015 by mgambone2


I'm trying to modify the JavaScript for adding shapefile to a basemap (script found here:  Add shapefile | ArcGIS API for JavaScript ).  However, I'm trying to get this functionality on my website whereby user specifies the shapefile's filename; then behind the scene, the script retrieves the shapefile from a folder in the website and adds the specified shapefile to the basemap.


How do I do this?  Been trying but unsuccessful.  I have an HTML button that I want the user to click and (without navigating to the location of the shapefile--since it's a website), the shapefile is added.  So, I'm trying to achieve something like the following for the button:



<button type="submit" id="btnAddShp" name="Command" value="Add Shapefile" class="btn btn-cyan2 btn-sm" onclick="addShapefile()">Add Shapefile</button>


Appreciate any help.