"Adding features from a file" using the API

Discussion created by stevel on Aug 22, 2011
I got an email from ESRI today showing how to add shapefiles, textfiles or GPS files to an map, including by drag+drop (details here if you missed it).

This looks great - can we do the same using the JS API directly?

The sample here shows how to use drag+drop but I'm more interested in the ability to load a local shapefile, using an Add Data methodology (so it'll work on IE and Safari).

Could we have a sample showing how to add a local shapefile to a JS API map?