I have been struggling with this for a while now. I managed to download .dbf & .xml files just fine, but am stuck on downloading a .gdb from an FTP site. Is there a way to do this without having to list every single file within the geodatabase.
Get the site to zip up the folder first. Then download the zip. Or use the new package format (*.pkg) when exporting from ArcMap which is the same thing.
This is the code I am using to download the .dbf & xml tables. # import FTP library from ftplib import FTP
# This will handle the data being downloaded def handleDownload(block): file.write(block) print ".",
# Log in to the server ftp = FTP('NAME') ftp.login('user', 'password') # Go to a specific directory & get a list of contents directory = 'gis/Taxlots/GIS_DATA/Tables' print 'Changing to' + directory ftp.cwd(directory) ftp.retrlines('LIST')
# File to download filename = 'Charac.dbf'
# Open the file for writing in binary mode print 'Opening local file ' + filename file = open('Charac.dbf', 'wb')
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.