Hello
I'm making a geoprocessing service that returns a .pdf file
As I saw in some examples I used the scratchFolder :
Once published on the server, the file is recorded here :
D:\arcgisserver\directories\arcgisjobs\myGeoprocessing\j8ba6feb42bce4586971ad1abc33aac81\scratch\myPDFFILE.pdf
When I use the geoprocessingService it returns an 'url' :
http://myServer:6080/arcgis/rest/dir.../myPDFFILE.pdf
----------------------------------------------------------
Here is my problem :
I'd like to return more than just a file. I'd like to return an object that contains my file directory and other pieces of information.
In this case, my pdf directory is inside an object. Once published on the server, the physical windows path is no longer converted as a server 'url' (so the client receives : 'D:\arcgisserver\directories\arcgisjobs\myGeoprocessing\j8ba6feb42bce4586971ad1abc33aac81\scratch\myPDFFILE.pdf')
Is it possible to explicitly call the function that convert the physical windows path to an url ?
If this is not possible, is there a better way to achieve what I'm trying to do ?
I'm making a geoprocessing service that returns a .pdf file
As I saw in some examples I used the scratchFolder :
Code:
outputFile = os.path.join(arcpy.env.scratchFolder, myPDFFile)
arcpy.SetParameterAsText(7, outputFile)
D:\arcgisserver\directories\arcgisjobs\myGeoprocessing\j8ba6feb42bce4586971ad1abc33aac81\scratch\myPDFFILE.pdf
When I use the geoprocessingService it returns an 'url' :
http://myServer:6080/arcgis/rest/dir.../myPDFFILE.pdf
----------------------------------------------------------
Here is my problem :
I'd like to return more than just a file. I'd like to return an object that contains my file directory and other pieces of information.
Code:
def packResultsToJson(result):
# -- result looks like :
# result={}
# result['succeed']=True
# result['url']=myPDFFile
# result['failedLayers']=failedServices
# result['error']="NoError"
# result['timeElapsed'] = str(time.time() - start_time) + " seconds"
arcpy.SetParameterAsText(7, result)
Is it possible to explicitly call the function that convert the physical windows path to an url ?
If this is not possible, is there a better way to achieve what I'm trying to do ?