Lädt...

🔧 Ftp client with GUI Python🐱‍🏍


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Ok let's dive in to the project. and this is my first post hear so you know what I'm talking about. Main libraries I use are the FTPlib and customtinter for the GUI.

Source code :

GitHub logo ukihunter / Python-FTP-Client

A simple and efficient FTP client built with Python, allowing users to connect to FTP servers, upload/download files, and manage directories seamlessly.

🌐🚀 Python FTP Client

A powerful yet simple FTP client built with Python, allowing seamless file transfers between local and remote servers. Perfect for managing FTP connections with ease!

forest

🎯 Key Features

✔️ Connect to any FTP server securely
📂 Upload & Download files effortlessly
📁 Manage Directories (list, rename, delete)
🔄 Transfer Status Updates in real-time
🔒 Secure & User-Friendly

🔧 Installation

1️⃣ Clone the Repository

git clone https://github.com/Ukihanter/Python-FTP-Client/tree/main
cd your-repo-name  

2️⃣ Install Dependencies

pip install -r requirements.txt  

🚀 How to Use

⚡ Run the FTP Client:

python gui.py  

💡 Enter FTP server details and start transferring files easily!

📦 Requirements

🔹 Python 3.x
🔹 ftplib (Built-in)
🔹 Any additional dependencies in requirements.txt
🔹 Defult local path is set to D:\ Feel free to edit it.

📜 License

📄 Open-source under the MIT License – Feel free to contribute!

🔗 Contribute & Star ⭐ the project if you find


Making the GUI
  • First i created the GUI using Figma.and i used a tool called Tkinter-Designer to import them to the python Gui it is a very easy way to make python GUI but it has some downfalls.

  • Tkinter-Designer :https://github.com/ParthJadhav/Tkinter-Designer

  • Video Tutorial : https://www.youtube.com/watch?v=oLxFqpUbaAE&t=562s

  • Documentation : https://github.com/ParthJadhav/TkinterDesigner/blob/master/docs/instructions.md

  • After creating the GUI you can go to the next step 🤓

Cording

Requirements :

# This project uses Python's standard libraries only.
# No additional packages need to be installed.

# Optional: Specify Python version if needed
# python_version >= 3.9

Now we have to import the libraries that we used for this project.

import os                  # For operating system/file handling
from pathlib import Path   # For path manipulation
from ftplib import FTP     # For FTP protocol operations
import datetime            # For timestamp handling
from tkinter import ttk, messagebox     # GUI components
import tkinter as tk
from tkinter import Tk, Canvas, Entry, Text, Button, PhotoImage

These are the Generated by the Tkinter-Designer and you don't have to worry about that

# Set up paths for GUI assets
OUTPUT_PATH = Path(__file__).parent
ASSETS_PATH = OUTPUT_PATH / Path(r"C:\Users\GIGABYTE\Desktop\New folder (4)\build\build\assets\frame0")

def relative_to_assets(path: str) -> Path:
    """Helper function to create absolute paths for GUI assets"""
    return ASSETS_PATH / Path(path)

Basic GUI model

# Create main application window
window = Tk()
window.title("FTP client By uki")
window.geometry("1280x720")
window.configure(bg="#2B2B2B")  # Dark background color

Defining the Default file path to the client

# Global variables for FTP connection and navigation
ftp = None  # Will hold the FTP connection object
current_ftp_path = "/"  # Current directory on FTP server
current_local_path = "D:/"  # Current directory on local machine

issue : I used the default "D:/" because if you put this in to
C:/ it will return with access denied error.

Now we going to received the files from the local machine in hear i used the Tree view to show case the files it also use try function to update the file list .in the end as you can see it has Error handling and to Permission Error and Exception

File receiving

This part in the code handle the navigation in the local machine decretory using Double click function.

Navigation in local machine

Nowlocal_go_back function handle the back navigation in the local machine directory.
GO back function

Now it take the input hostusernamepassword and it use try function to establish the connection to the server. if the connection successful it return the log as ✅ Connected successfully! if not it return the Exception Error
Stablish the connection to server

Now List down the Host files as same as local machine and also error handling

List down the Host files

Handling the file navigation in the Host :
navigation in the Host

Host and local file Tree view stretcher :
local file

Host file

loading the decretory when loading(in this case it DriveD:/)

Image description

Button stretcher and function calling :

Connecting button

This Button is the tiger that to connect to the ftp server command=connect_to_ftp, other variables are the design and the position of the button

Delete Button
Delete Button

This Button is the tiger that to delete selected file from the ftp server command=delete_file, other variables are the design and the position of the button

Upload Button
Upload Button

This Button is the tiger that to Upload selected file from the local client command=upload_file, other variables are the design and the position of the button

Download Button
Download Button

This Button is the tiger that to Download selected file from the Host Server command=download_file, other variables are the design and the position of the button

Main function in the Ftp client

Download function
Download function

when the download_file function tiger it check the connection and try to dowanlad the selcted file from the host if not it return error massages using messagebox if all good it save the file to the local path.

Upload function
Upload function

This function also have the same procedure except it upload file to the host and also provide necessary error massages.

Deleting function
Deleting function

Function that delete file from the host this can't be perform in the local machine.

Path verification

Upload log
Upload path
logging the uploading success This Enter the text to entry_4

*Download log *
Download path
logging the Downloading success. This Enter the text to entry_4

Ok now you know how it happened. I know this can be a real boring one for you .maybe not.However this is my first article you can wish me luck 😉

...

📰 How to Install Winscp FTP Client/SFTP Client/SCP Client (WinSCP Client) In Ubuntu


📈 33.69 Punkte
📰 Alle Kategorien

🔧 Ftp client with GUI Python🐱‍🏍


📈 30.77 Punkte
🔧 Programmierung

🍏 Viper FTP 6.3.3 - Handy FTP client (was ViaFTP).


📈 24.51 Punkte
🍏 iOS / Mac OS

🔧 Create Tkinter GUI’s using Tkinter GUI Builder — PyUiBuilder


📈 21.14 Punkte
🔧 Programmierung

🕵️ CVE-2023-49580 | SAP GUI for Windows/GUI for Java access control


📈 21.14 Punkte
🕵️ Sicherheitslücken

🕵️ CVE-2023-26922 | Varisicte matrix-gui 2.0 matrix-gui-2.0 shell_exect sql injection


📈 21.14 Punkte
🕵️ Sicherheitslücken

📰 DNSrecon-gui - DNSrecon Tool With GUI For Kali Linux


📈 21.14 Punkte
📰 IT Security Nachrichten

📰 Volatility GUI - GUI For Volatility Forensics Tool


📈 21.14 Punkte
📰 IT Security Nachrichten

🐧 Ubuntu 20.04: Switching from GUI to CLI, get a ghost cursor in the GUI


📈 21.14 Punkte
🐧 Linux Tipps

🕵️ Monero GUI 0.17.0.1 monero-wallet-gui /usr/lib authorization


📈 21.14 Punkte
🕵️ Sicherheitslücken

📰 How to Install Mkvtoolnix GUI (Mkvmerge GUI) In Ubuntu – A Best MKV Editor for Linux


📈 21.14 Punkte
📰 Alle Kategorien

🕵️ CVE-2021-4189 | Python FTP Client Library return value


📈 20.2 Punkte
🕵️ Sicherheitslücken

🕵️ Squid Proxy up to 2.5.STABLE11 FTP Proxy FTP Reply denial of service


📈 18.38 Punkte
🕵️ Sicherheitslücken

🕵️ Typsoft Typsoft Ftp Server 1.10 FTP Server denial of service


📈 18.38 Punkte
🕵️ Sicherheitslücken

🕵️ Crob FTP 3.6.1 FTP Command memory corruption


📈 18.38 Punkte
🕵️ Sicherheitslücken

🕵️ GlobalSCAPE Secure FTP Server 3.0.2 FTP Command memory corruption


📈 18.38 Punkte
🕵️ Sicherheitslücken

🕵️ FaSTream FTP++ Server 2.0 FTP Command ls Directory information disclosure


📈 18.38 Punkte
🕵️ Sicherheitslücken

🔧 A Beginner's Guide to FTP: How to Use FTP for File Transfers


📈 18.38 Punkte
🔧 Programmierung

🕵️ TYPSoft FTP Server 0.85 FTP Command CWD directory traversal


📈 18.38 Punkte
🕵️ Sicherheitslücken

🕵️ TYPSoft FTP Server 0.85 FTP Command CWD directory traversal


📈 18.38 Punkte
🕵️ Sicherheitslücken

🐧 FTP-Port: Passives und aktives FTP im Überblick


📈 18.38 Punkte
🐧 Server

🕵️ Ipswitch WS FTP Server 2.02 FTP Command memory corruption


📈 18.38 Punkte
🕵️ Sicherheitslücken

🐧 FTP-Commands: Die 25 wichtigsten FTP-Befehle und ihre Verwendung


📈 18.38 Punkte
🐧 Server

🕵️ Transsoft Broker FTP Server 5.5 FTP Command DELETE/LIST directory traversal


📈 18.38 Punkte
🕵️ Sicherheitslücken

🪟 3 geniale kostenlose FTP-Tools: FTP-Clients & -Server


📈 18.38 Punkte
🪟 Windows Tipps

matomo