Build Your Own File-Transfer App Using Python Within 5 Minutes
Learn how to make a secure file-transfer application
--
One of the biggest problems I find with any commercial app is you never know who’s accessing your personal information. Anything shared among people on the internet will always be subject to attacks, like those of MITM.
Chat, photo, and file-transfer applications, only to name a few, are the most popular criminal targets. If you’re like me, meaning being skeptical when using free stuff, you’ll always try to find a better way around. Today, we’ll make our own simple file-transfer program using Python.
File Transfer
A file transfer is the copying or moving of a file from one computer to another over a network or internet connection.
We’ll go step by step through how to write both a client and server Python script that can handle just that. The idea is to create a server that listens on a particular port. The server will be responsible for receiving files. On the other hand, the client will try to connect to the server and send a file of any type. You can make the server sends files as well.
I’ll be using the Python socket module, which provides us with socket operations widely used on the internet as they’re behind any connection to any network.
This related project also used sockets to send email notifications whenever the script found items within the price range I needed at the moment.
The Server
- Line 2:
tqdm
will enable us to print a progress bar. - Line 5 :
“0.0.0.0”
will be used as the server IP address — this means all IPv4 addresses on the local machine. If you’re…