<?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 Is there a way to download a .GDB from an FTP site... in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/is-there-a-way-to-download-a-gdb-from-an-ftp-site/m-p/605646#M47361</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been struggling with this for a while now. I managed to download .dbf &amp;amp; .xml files just fine, but am stuck on downloading a .gdb from an FTP site. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to do this without having to list every single file within the geodatabase. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is much appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Zlatko Grebenar&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;City of Nampa GIS&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-email-small" href="mailto:grebenarz@cityofnampa.us"&gt;grebenarz@cityofnampa.us&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Feb 2012 15:36:00 GMT</pubDate>
    <dc:creator>ZlatkoGrebenar1</dc:creator>
    <dc:date>2012-02-17T15:36:00Z</dc:date>
    <item>
      <title>Is there a way to download a .GDB from an FTP site...</title>
      <link>https://community.esri.com/t5/python-questions/is-there-a-way-to-download-a-gdb-from-an-ftp-site/m-p/605646#M47361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been struggling with this for a while now. I managed to download .dbf &amp;amp; .xml files just fine, but am stuck on downloading a .gdb from an FTP site. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to do this without having to list every single file within the geodatabase. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is much appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Zlatko Grebenar&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;City of Nampa GIS&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-email-small" href="mailto:grebenarz@cityofnampa.us"&gt;grebenarz@cityofnampa.us&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 15:36:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-a-way-to-download-a-gdb-from-an-ftp-site/m-p/605646#M47361</guid>
      <dc:creator>ZlatkoGrebenar1</dc:creator>
      <dc:date>2012-02-17T15:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to download a .GDB from an FTP site...</title>
      <link>https://community.esri.com/t5/python-questions/is-there-a-way-to-download-a-gdb-from-an-ftp-site/m-p/605647#M47362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Get the site to zip up the folder first. Then download the zip.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or use the new package format (*.pkg) when exporting from ArcMap which is the same thing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 18:03:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-a-way-to-download-a-gdb-from-an-ftp-site/m-p/605647#M47362</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2012-02-17T18:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to download a .GDB from an FTP site...</title>
      <link>https://community.esri.com/t5/python-questions/is-there-a-way-to-download-a-gdb-from-an-ftp-site/m-p/605648#M47363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kim, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the code I am using to download the .dbf &amp;amp; xml tables. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# import FTP library&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from ftplib import FTP&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# This will handle the data being downloaded&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;def handleDownload(block):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; file.write(block)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print ".",&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Log in to the server&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ftp = FTP('NAME')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ftp.login('user', 'password')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Go to a specific directory &amp;amp; get a list of contents&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;directory = 'gis/Taxlots/GIS_DATA/Tables'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Changing to' + directory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ftp.cwd(directory)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ftp.retrlines('LIST')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# File to download&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;filename = 'Charac.dbf'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Open the file for writing in binary mode&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Opening local file ' + filename&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;file = open('Charac.dbf', 'wb')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Download the file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Getting' + filename&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ftp.retrbinary('RETR Charac.dbf', handleDownload)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;file.close(); print 'Closing file' + filename&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Within the .gdb there are multiple files that I need to download. Do you know of a way to download all files within the specific .gdb by using the code above to retrieve all files. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Zlatko Grebenar&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="mailto:grebenarz@cityofnampa.us"&gt;grebenarz@cityofnampa.us&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 19:01:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-a-way-to-download-a-gdb-from-an-ftp-site/m-p/605648#M47363</guid>
      <dc:creator>ZlatkoGrebenar1</dc:creator>
      <dc:date>2012-02-22T19:01:13Z</dc:date>
    </item>
  </channel>
</rss>

