AnsweredAssumed Answered

submitJob and output directories

Question asked by jay.gregory on Oct 15, 2012
Latest reply on Oct 16, 2012 by jay.gregory
Hi, I have a simple geoprocessing service exposed to REST on ArcGIS for Server 10.0 (I've attached the screenshot here).
Using the JS API, I have a submitJob task that runs the geoprocessing tool (a lot of code was taken from this sample). However, the result KMZ file doesn't seem to be in the directory that job info claims. I modified the downloadfile function to
function downloadFile(outputFile){         console.log("downloading");;   console.log(outputFile);         var theurl = outputFile.value.url;           //window.location = theurl;       }

The outputFile.value.url is "http://myservername/arcgisjobs/export_gpserver/jc867301809404c4ba6065c514361806e/scratch/results.kmz, but when I navigate to that directory on the server, there is no results.kmz file there.

However, the output file does appear correctly in an entirely different directory: the one in which my original mxd exists from which I built the service and imported into ArcGIS Server Manager.  When I built my model in ModelBuilder, I made sure to check the "store relative path names" and specify the output directory of the results.kmz file to be %scratchworkspace%\export.kmz.  So why is the output file going to a completely different directory and not the arcgisjobs directory? 

On a somewhat related note, is this the best way to generate a KMZ from a user defined polygon? I know I can query the REST entpoint directly, but I'm unsure how to do that without directly making a GET or POST AJAX request in Javascript? But mostly, where is that KMZ file?

Thanks for your help....