Download Excel file as .zip file with Geoprocessing

1225
1
03-19-2019 09:48 AM
DEVAPP
by
New Contributor III

Hi,

I have an ArcGIS REST Service that shows me more different Table, all tables are stored into Oracle Geodatabase Enterprise. I have written a python script that calls the REST service, extract data and create an Excel file. The Excel is added into a zip file.

The zip file is written into the folder of the script. 

I have created a toolbox on ArcCatalog and I have set a parameter (GetParameterAsText as input) for the script.

When I run the script by ArcCatalog, works fine and the zip file is added into the folder.

After published on ArcGIS Server the script as Geoprocessing, I have noticed that the zip file is not written into folder arcgisjobs/gp/geoprocessing_name/scratch.

There is some sample to see how I can download specific .zip folder created by the script on the server?

The zip file contains all table data formatted into Excel

Thanks

Best

Tags (2)
0 Kudos
1 Reply
GurminderBharani1
New Contributor III

You can try the following steps:

The Output parameter first set it as derived in the script properties > parameters > parameter properties > type > derived. 

Also, keep the direction > output

Then in the script write:

arcpy.SetParameter(1,open(r"E:\IMAGERY\CSX\planet_order_321693\OutputGurminder\out.txt", "w"))

I am saving text in my case, in your case you call the method to save the excel zip file instead of open(). Then you go ahead and publish as a geoprocessing service.

-Gurminder