AnsweredAssumed Answered

How to alter the file name of an output file from a geoprocessing service

Question asked by paul.haakma on Apr 22, 2015
Latest reply on Apr 23, 2015 by paul.haakma

Hi. I have a python script that exports a pdf file. I have published this script as a geoprocessing service and successfully used this in a web application to publish and return that pdf to the user.


In the script properties defined in the toolbox within ArcMap prior to publishing, one of the parameters is the name of the file to return. This is currently set to '%ScratchWorkspace%/myfilename.pdf'. This works fine so long as the name of the file I create is called 'myfilename.pdf'. What I can't figure out is how I can create and return a file with a different name.


For example, the pdf might reference a particular job or client, and I might want to look up the client name and job id and return a file called 'bobjones_1234AB.pdf'. Under the current method, every pdf that the user publishes needs to be saved locally to disk then renamed to something more meaningful.


Does anyone know how I could tell the geoprocessing service to change the output file name parameter during the script?