Hi,
How can I get a geoprocessing service to return a file?
I published a GP
<SPAN class="keyword token">if</SPAN> __name__ <SPAN class="operator token">==</SPAN> <SPAN class="string token">'__main__'</SPAN><SPAN class="punctuation token">:</SPAN>
file <SPAN class="operator token">=</SPAN> open<SPAN class="punctuation token">(</SPAN>arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>scratchWorkspace<SPAN class="operator token">+</SPAN> <SPAN class="string token">"/"</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">"test.txt"</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"w"</SPAN><SPAN class="punctuation token">)</SPAN>
file<SPAN class="punctuation token">.</SPAN>write<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"why"</SPAN><SPAN class="punctuation token">)</SPAN>
file<SPAN class="punctuation token">.</SPAN>close<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>SetParameter<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN> file<SPAN class="punctuation token">.</SPAN>name<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>':
however i kept receiving the
"value": "d:\\arcgisserver\\directories\\arcgisjobs\\script_gpserver\\j94a7e5b06f3342deb0ebcb65467f63fe\\scratch/test.txt"
I can see the file in the scratch folder but i need to return the file some how.

I did try to access the file via different permutation of
https://example.com/arcgis/rest/services/Script/GPServer/Script/jobs/j94a7e5b06f3342deb0ebcb65467f63fe/scratch/text.txt to no avail
Can someone kindly assist.