How to Use FTP / FTP_TLS in Python to List, Upload, and Download Files



How to Use FTP / FTP_TLS in Python to List, Upload, and Download Files

How to Use FTP / FTP_TLS in Python to List, Upload, and Download Files

In this episode, we’re going to look at how to use FTP in our Python code so that we can list, upload, and download files using the native Python FTP library. We’ll also demonstrate one big gotcha (and workaround) that can cause your session to hang when you upload files on a Microsoft FTP server when using this library. This will focus on FTP TLS that has some added security when compared to a standard FTP session, but the commands are almost the same between the two. In this example, I am using ftplib to access a Microsoft App Service to manage aspx files for a dummy asp.net application on Azure.

For developers looking for a new role, check out and sign up:
https://www.toptal.com/qKaO2b/worlds-top-talent

Needing to hire technical resources for your project? Get the best:
https://www.toptal.com/qKaO2b/worlds-top-talent

Want to get access to premium content made just for you and have a chat with me? Find me on Patreon :

https://www.patreon.com/mackenziedataengineering

Want to work with me 1:1? Contact me today and book your free 20 min consultation!

Contact form you can find at http://www.mackenziemackenzie.com/

Follow me on social media:
https://www.facebook.com/mackenziedataanalytics
https://twitter.com/seamacke
https://www.instagram.com/seamacke/
https://www.reddit.com/user/seamacke
https://www.linkedin.com/in/psmackenzie/

Get Microsoft Office including Access:
https://click.linksynergy.com/fs-bin/click?id=BdGJecFFM8A&offerid=1160033.10004289&type=3&subid=0

Got a YouTube Channel? I use TubeBuddy, it is awesome. Give it a try:
https://www.tubebuddy.com/seanmackenziedataengineering

#python #ftp #dataengineering

Comments are closed.