Hi,
I want to download a file created by a Geoprocessing Service. For testing, I created a Service from the script below. The script is having a user supplied input of type String and a derived output of type File.
import os
input_from_client = arcpy.GetParameterAsText(0)
file = open("testfile.txt","w")
file.write(input_from_client)
file.close()
arcpy.SetParameter(1, file)
I thought that I can simply set the created file as output parameter (arcpy.SetParameter) and would then be able to download it with the returned url.
Yet, when running the service with the REST interface, it returns an incorrect url (note the <_io.TextIOWrapper name='testfile.txt' mode='w' encoding='cp1252'> part in the end):
{
"paramName": "File",
"dataType": "GPDataFile",
"value": {
"url": "https://[nameofserver]/gis/rest/directories/arcgisjobs/excelreportservice_gpserver/j3ddfaa172cc7477288253c965e3c3aba/scratch/<_io.TextIOWrapper name='testfile.txt' mode='w' encoding='cp1252'>"
}
}
Any ideas how I can get the correct download url?
Would be very thankful for support on this.
Regards, Lukas