<?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: Batch Download from Links in Attribute Table in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/batch-download-from-links-in-attribute-table/m-p/1416550#M82507</link>
    <description>&lt;P&gt;Sorry I wasn't checking this! I appreciate your help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://download.fri.mnrf.gov.on.ca/api/api/Download/geohub/laz/utm16/1kmZ164040565102023L.copc.laz" target="_blank"&gt;https://download.fri.mnrf.gov.on.ca/api/api/Download/geohub/laz/utm16/1kmZ164040565102023L.copc.laz&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2024 15:02:26 GMT</pubDate>
    <dc:creator>BradParkinson</dc:creator>
    <dc:date>2024-04-29T15:02:26Z</dc:date>
    <item>
      <title>Batch Download from Links in Attribute Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/batch-download-from-links-in-attribute-table/m-p/1413649#M82226</link>
      <description>&lt;P&gt;I'm trying to implement some LiDAR data into my ArcGIS Pro work. The data I want to access is packaged into tiles, each hosted as their own feature in a single layer. These tiles contain a hyperlinked URL in the attribute table, which allow me to download the corresponding .laz files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to download several hundred of these files, and I think Python would be a good choice to automate the downloading for me. Does anybody have pointers, tips, etc? I've seen mention of a 'for loop', would that be appropriate for this type of task?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-22 141455.png" style="width: 488px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/101713i546F39A6AD1ECE9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-04-22 141455.png" alt="Screenshot 2024-04-22 141455.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 18:18:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/batch-download-from-links-in-attribute-table/m-p/1413649#M82226</guid>
      <dc:creator>BradParkinson</dc:creator>
      <dc:date>2024-04-22T18:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Download from Links in Attribute Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/batch-download-from-links-in-attribute-table/m-p/1415487#M82402</link>
      <description>&lt;P&gt;would it be possible to supply the complete Download_L URL for testing?&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 18:55:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/batch-download-from-links-in-attribute-table/m-p/1415487#M82402</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-04-25T18:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Download from Links in Attribute Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/batch-download-from-links-in-attribute-table/m-p/1416550#M82507</link>
      <description>&lt;P&gt;Sorry I wasn't checking this! I appreciate your help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://download.fri.mnrf.gov.on.ca/api/api/Download/geohub/laz/utm16/1kmZ164040565102023L.copc.laz" target="_blank"&gt;https://download.fri.mnrf.gov.on.ca/api/api/Download/geohub/laz/utm16/1kmZ164040565102023L.copc.laz&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 15:02:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/batch-download-from-links-in-attribute-table/m-p/1416550#M82507</guid>
      <dc:creator>BradParkinson</dc:creator>
      <dc:date>2024-04-29T15:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Download from Links in Attribute Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/batch-download-from-links-in-attribute-table/m-p/1416612#M82510</link>
      <description>&lt;P&gt;Pretty basic, no error testing, but should get you started.&lt;/P&gt;&lt;P&gt;I do check to make sure the file hasn't already been downloaded:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, os, urllib.request

fc = r'\\servername\sharename\folder\Pro_Test_map.gdb\TestFC'  # input feature class with URL attribute

outfold = r'C:\Users\myusername\Desktop\tmp'              #location to save laz files

with arcpy.da.SearchCursor(fc, ['Download_L']) as cursor:    # establish search cursor with "Download_L" as url field
    for row in cursor:                                 # iterate trough list of files
        infile = os.path.basename(row[0])              # get existing filename
        outfile = outfold + os.sep + infile            # set new filename/location                             
        if not os.path.exists(outfile):                # check to make sure file doesn't already exist
            print("downloading - " + outfile)
            urllib.request.urlretrieve(row[0], outfile)  # download the file
        else: print(outfile + '   already exists')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 18:56:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/batch-download-from-links-in-attribute-table/m-p/1416612#M82510</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-04-29T18:56:52Z</dc:date>
    </item>
  </channel>
</rss>

