<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867244#M4474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you should return "vOutputFile" instead of "aFile" in the&amp;nbsp;SetParamter function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Jun 2020 19:51:47 GMT</pubDate>
    <dc:creator>LanceKirby2</dc:creator>
    <dc:date>2020-06-24T19:51:47Z</dc:date>
    <item>
      <title>Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867241#M4471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an ExportExcelFile geoprocessing service developed in ArcPy and I want the user to get the download file URL returned so that they can click on the link and download the Excel file.&amp;nbsp; &amp;nbsp;The geoprocessing service is called from a Portal Web App Geoprocessing widget.&amp;nbsp; &amp;nbsp;I can get the string result but that needs to be copied and pasted into another browser tab to work.&amp;nbsp; I just want the user to click on the download URL link.&amp;nbsp; &amp;nbsp;I am returning an output parameter of type "File" but only getting an object [object] in the results.&amp;nbsp; &amp;nbsp;Here is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;arcpy,&amp;nbsp;os,&amp;nbsp;json,&amp;nbsp;sys,&amp;nbsp;zipfile,&amp;nbsp;urllib&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.env.overwriteOutput&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;True&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;####################################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;###&amp;nbsp;setting&amp;nbsp;variable&amp;nbsp;default&amp;nbsp;values&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;####################################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.env.scratchWorkspace&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"//HERTZGIS/directories/arcgisoutput/PortalShapefiles/"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#&amp;nbsp;Shapefile&amp;nbsp;output&amp;nbsp;folder&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;exportFolder&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"//HERTZGIS/directories/arcgisoutput/PortalShapefiles/"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Output&amp;nbsp;folder&amp;nbsp;is&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;exportFolder)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#############################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;###&amp;nbsp;Getting&amp;nbsp;input&amp;nbsp;parameters&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#############################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&amp;nbsp;&amp;nbsp;Collecting&amp;nbsp;input&amp;nbsp;parameters"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#&amp;nbsp;Get&amp;nbsp;the&amp;nbsp;passed&amp;nbsp;field&amp;nbsp;polygon&amp;nbsp;graphics&amp;nbsp;and&amp;nbsp;user&amp;nbsp;specified&amp;nbsp;shapefile&amp;nbsp;name&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;inFeatset&amp;nbsp;=&amp;nbsp;arcpy.GetParameter(&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;inFeatset&amp;nbsp;==&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'#'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;inFeatset:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sys.exit()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;xlsFileName&amp;nbsp;=&amp;nbsp;arcpy.GetParameterAsText(&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;outputExcelFile&amp;nbsp;=&amp;nbsp;exportFolder&amp;nbsp;+&amp;nbsp;xlsFileName&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;".xls"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;xlsFileName:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sys.exit()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Output&amp;nbsp;file&amp;nbsp;is&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;outputExcelFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#############################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;###&amp;nbsp;start&amp;nbsp;main&amp;nbsp;proccess&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#############################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;try&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Running&amp;nbsp;shapefile&amp;nbsp;export&amp;nbsp;to&amp;nbsp;create&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;outputExcelFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.TableToExcel_conversion(inFeatset,&amp;nbsp;outputExcelFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Created&amp;nbsp;shapefile:&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;xlsFileName&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;".xls"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #6a9955;"&gt;#&amp;nbsp;put&amp;nbsp;the&amp;nbsp;files&amp;nbsp;that&amp;nbsp;make&amp;nbsp;up&amp;nbsp;the&amp;nbsp;shapefile&amp;nbsp;into&amp;nbsp;a&amp;nbsp;zip&amp;nbsp;file&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;zip&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;=&amp;nbsp;zipfile.ZipFile(exportFolder&amp;nbsp;+&amp;nbsp;xlsFileName&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;".zip"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'w'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;zipfile.ZIP_DEFLATED)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;os.listdir(exportFolder):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.startswith(xlsFileName):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.endswith(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;".zip"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(os.path.join(exportFolder,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;zip&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.write(os.path.join(exportFolder,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;zip&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.close()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vOutputFile&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"https://HERTZGIS/PortalShare/"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;xlsFileName&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;".xls"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;aFile&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;open&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(vOutputFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;aFile.close()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(vOutputFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.SetParameter(&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;aFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;except&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Error&amp;nbsp;exporting&amp;nbsp;and&amp;nbsp;downloading&amp;nbsp;shapefile&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;outputExcelFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2020 17:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867241#M4471</guid>
      <dc:creator>JeffHanson2</dc:creator>
      <dc:date>2020-06-24T17:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867242#M4472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you set the Parameter as Output and 'Derived'? Because you're saving to a known location, the tool doesn't have a traditional output to serve.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2020 19:23:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867242#M4472</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-06-24T19:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867243#M4473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I have done that.&amp;nbsp; I am now looking at the urllib2 module.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2020 19:26:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867243#M4473</guid>
      <dc:creator>JeffHanson2</dc:creator>
      <dc:date>2020-06-24T19:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867244#M4474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you should return "vOutputFile" instead of "aFile" in the&amp;nbsp;SetParamter function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2020 19:51:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867244#M4474</guid>
      <dc:creator>LanceKirby2</dc:creator>
      <dc:date>2020-06-24T19:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867245#M4475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did try that but just get object [object] back from the geoprocessing service in Portal.&amp;nbsp; &amp;nbsp;I will solve this and post the solution but it may be tomorrow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2020 19:59:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867245#M4475</guid>
      <dc:creator>JeffHanson2</dc:creator>
      <dc:date>2020-06-24T19:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867246#M4476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have solved the issue.&amp;nbsp; The GP service output should be of type "File".&amp;nbsp; &amp;nbsp;The user can click a link and the zip file downloads.&amp;nbsp; The Portal arcgisjobs folder is used for the shapefile and the zip file.&amp;nbsp; &amp;nbsp;Code to follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#&amp;nbsp;ExportShapefile&amp;nbsp;-&amp;nbsp;Created&amp;nbsp;by&amp;nbsp;Jeff&amp;nbsp;Hanson,&amp;nbsp;HFM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#&amp;nbsp;Purpose:&amp;nbsp;&amp;nbsp;to&amp;nbsp;export&amp;nbsp;selected&amp;nbsp;featues&amp;nbsp;to&amp;nbsp;a&amp;nbsp;usernamed&amp;nbsp;shapefile&amp;nbsp;as&amp;nbsp;a&amp;nbsp;geoprocessing&amp;nbsp;servie&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#&amp;nbsp;Note:&amp;nbsp;&amp;nbsp;the&amp;nbsp;output&amp;nbsp;directory&amp;nbsp;is&amp;nbsp;PortalShapeFiles&amp;nbsp;on&amp;nbsp;Hertzgis&amp;nbsp;server,&amp;nbsp;a&amp;nbsp;shared&amp;nbsp;folder&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;arcpy,&amp;nbsp;os,&amp;nbsp;json,&amp;nbsp;sys,&amp;nbsp;zipfile,&amp;nbsp;urllib2&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.env.overwriteOutput&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;True&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;####################################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;###&amp;nbsp;setting&amp;nbsp;variable&amp;nbsp;default&amp;nbsp;values&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;####################################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Default&amp;nbsp;scratch&amp;nbsp;GDB&amp;nbsp;is:"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(arcpy.env.scratchGDB)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"*******************************"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#&amp;nbsp;Excel&amp;nbsp;table&amp;nbsp;output&amp;nbsp;folder&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;exportFolder&amp;nbsp;=&amp;nbsp;arcpy.env.scratchGDB&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;jobsDir&amp;nbsp;=&amp;nbsp;os.path.dirname(os.path.abspath(exportFolder))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Export&amp;nbsp;Folder:&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;exportFolder)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Jobs&amp;nbsp;Dir:&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;jobsDir)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#############################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;###&amp;nbsp;Getting&amp;nbsp;input&amp;nbsp;parameters&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#############################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Collecting&amp;nbsp;input&amp;nbsp;parameters"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#&amp;nbsp;Get&amp;nbsp;the&amp;nbsp;passed&amp;nbsp;field&amp;nbsp;polygon&amp;nbsp;graphics&amp;nbsp;and&amp;nbsp;user&amp;nbsp;specified&amp;nbsp;shapefile&amp;nbsp;name&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;inFeatset&amp;nbsp;=&amp;nbsp;arcpy.GetParameter(&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;inFeatset&amp;nbsp;==&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'#'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;inFeatset:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sys.exit()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;shpFileName&amp;nbsp;=&amp;nbsp;arcpy.GetParameterAsText(&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;outputShapeFile&amp;nbsp;=&amp;nbsp;jobsDir&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\\&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;shpFileName&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;".shp"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;shpFileName:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sys.exit()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Output&amp;nbsp;file&amp;nbsp;is&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;outputShapeFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#############################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;###&amp;nbsp;start&amp;nbsp;main&amp;nbsp;proccess&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #6a9955;"&gt;#############################&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;try&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Running&amp;nbsp;shapefile&amp;nbsp;export&amp;nbsp;to&amp;nbsp;create&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;outputShapeFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.CopyFeatures_management(inFeatset,&amp;nbsp;outputShapeFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Created&amp;nbsp;shapefile:&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;outputShapeFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #6a9955;"&gt;#&amp;nbsp;put&amp;nbsp;the&amp;nbsp;files&amp;nbsp;that&amp;nbsp;make&amp;nbsp;up&amp;nbsp;the&amp;nbsp;shapefile&amp;nbsp;into&amp;nbsp;a&amp;nbsp;zip&amp;nbsp;file&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;zip&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;=&amp;nbsp;zipfile.ZipFile(jobsDir&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\\&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;shpFileName&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;".zip"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'w'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;zipfile.ZIP_DEFLATED)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;os.listdir(jobsDir):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.startswith(shpFileName):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;not&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.endswith(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;".zip"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(os.path.join(jobsDir,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;zip&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.write(os.path.join(jobsDir,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;zip&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.close()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Zip&amp;nbsp;file&amp;nbsp;created."&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;outputFile&amp;nbsp;=&amp;nbsp;jobsDir&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\\&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;shpFileName&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;".zip"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Return&amp;nbsp;file&amp;nbsp;is&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;outputFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.SetParameter(&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;outputFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt;except&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Error&amp;nbsp;exporting&amp;nbsp;and&amp;nbsp;downloading&amp;nbsp;shapefile&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;+&amp;nbsp;outputShapeFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sys.exit()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 15:55:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867246#M4476</guid>
      <dc:creator>JeffHanson2</dc:creator>
      <dc:date>2020-07-02T15:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867247#M4477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad you figured it out. I am working on a similar gp service where the user selects a layer in the first parameter and provides a string for the name in the second parameter. A shapefile and kmz are created from that layer and returned to the user. I am experiencing this issue described below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;User runs gp service with LayerX selected.&lt;OL&gt;&lt;LI&gt;Everything comes back fine.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;They filter layerX in map and run gp service again with layerX selected in first parameter.&lt;OL&gt;&lt;LI&gt;Problem - They get back same result run from their initial run.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if you are doing the same workflow, but it sounds similar. If you are, can you tell me if you're running into that same issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 16:37:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867247#M4477</guid>
      <dc:creator>LanceKirby2</dc:creator>
      <dc:date>2020-07-02T16:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867248#M4478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm only returning one output file, are you returning two?&amp;nbsp; A shapefile and a KMZ?&amp;nbsp; Maybe you need 2 output parameters, one for each file type.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 17:48:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867248#M4478</guid>
      <dc:creator>JeffHanson2</dc:creator>
      <dc:date>2020-07-02T17:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867249#M4479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's right I am returning two files through two SetParameterAsText parameters. I have no trouble returning each file, but it's more like the call from gp widget to gp service gets stuck on the first arguments passed when using the same layer. I assume in your workflow the user could filter a layer in the attribute table, select that layer in the gp widget, and it will only export data for what was filtered. Is that correct? If so, could you run that, then go filter the same layer again and run the gp widget again? I'm curious if your data will update to reflect the filtered changes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 18:24:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867249#M4479</guid>
      <dc:creator>LanceKirby2</dc:creator>
      <dc:date>2020-07-02T18:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867250#M4480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do a SetParameter output object, not AsText, and in the properties of the gp service toolbox in ArcCatalog I set the Output type to "File" -&amp;nbsp;this returns a hyperlink that when clicked downloads the file.&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.SetParameter(&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;outputExcelFile)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/498734_pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 19:08:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867250#M4480</guid>
      <dc:creator>JeffHanson2</dc:creator>
      <dc:date>2020-07-02T19:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867251#M4481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the tip. I will try using SetParameter instead. I believe the problem lies with the argument being sent to the gp service and not what is returned. I take it that you aren’t experiencing&amp;nbsp;the issue I am describing above?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 20:52:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/867251#M4481</guid>
      <dc:creator>LanceKirby2</dc:creator>
      <dc:date>2020-07-02T20:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Download a zip file with an ArcPY geoprocessing service in ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/1383555#M9662</link>
      <description>&lt;P&gt;Thank you! I've done this several times and it worked but this time I forgot to change it and it stayed at the default "String".&amp;nbsp; You've saved me much frustration.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 18:39:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/download-a-zip-file-with-an-arcpy-geoprocessing/m-p/1383555#M9662</guid>
      <dc:creator>ShariF</dc:creator>
      <dc:date>2024-02-16T18:39:38Z</dc:date>
    </item>
  </channel>
</rss>

