Solved! Go to Solution.
I don't think you can do this directly through the Javascript API.
One thing you can do is:
Author and publish a geoprocessing service using model builder or arcpy that does de job of converting GPX data do Feature Class (more info: http://resources.arcgis.com/en/help/main/10.2/index.html#//001200000050000000), execute this geoprocessing service and add the resultant layer to the map through the Javascript API.
Regards.
Roberto Pepato.
Let me see if I got it right:
What you're saying is that you need to know how to set the Input_GPX_File parameter to the GP service?
If the answer is yes, I think that you should use a file uploader component to upload the gpx file to a directory on the remote file system (your webserver). This directory should be shared and accessible by the server that was running AGS (in case of separate servers). Then, you could assume that your AGS server already knows the path to the remote directory( e.g. /mnt/share/gpxfiles ) and you can compose the already know part with the file name after the upload and prior to the GP execution.
For example, if you are processing a file called police.gpx, assuming the fixed prefix, you could just build the "/mnt/share/gpxfiles/police.gpx" string and pass it to te GP Service. Better yet, you can compose this string inside the GP service so nobody will never now the paths to your filesystem.
Regards.
Roberto Pepato.
see http://studioat.maps.arcgis.com/home/item.html?id=10ffc2f50f6c430b912cf23ae8e2643b