I am currently trying to develop a python script which output should be downloadable as a file. It should behave just like a printing service, that is, sending back a link to the result. The issue is that I still haven't found out how to copy the result to the output folder and then make a link pointing to it. Do I have to send that path as an input parameter? Is there a special name - arcpy.env.outputfolder or similar- that would help me?
Thank you very much in advance
You'll want to set the output as a File data type and set it as an Output and Derived. Once the task is completed in the client, it should prompt the browser to ask you to download the file.
Thank you very much Jonathan
Please let me know if I am getting it right. I would process the file in an ordinary folder (e.g. c:\temp), then I would set it as an output parameter (e.g. arcpy.setParameter(1, c:\temp\txtfile.txt)) and finally, once the task is finished, the system itself would copy that file to the GPService output folder (which is a virtual directory too) and send a link back. Am I right?
Is there any help topic in which I could find a clear directive on this topic (output parameters in GPService)? I have been trying by myself, but couldn't find any
Once again, thank you very much in advance
It is better to save the file on Scratch Folder (arcpy.env.scratchFolder). As Jonathan Quinn said if you set the output parameter as File type then once the task is completed in the client, it should prompt the browser to ask you to download the file.