PYTHON-FTP Program

Source: Internet
Author: User

First, requirements:

User encryption authentication
Allow simultaneous multi-user logins
Each user has their own home directory and can only access their home directory
Disk quotas for users, with different free space per user
Allow user to switch directories at random on FTP server
Allow users to view files in the current directory
Allows uploading and downloading of files to ensure file consistency
Show progress bar during file transfer
Additional features: Support for file breakpoint continuation (download only)

Second, the directory structure:

.
├──ftp #ftp程序
││
│ ├──bin # Executable Program Entry directory
│ │  ├──__init__.py
│ │   └──start.py # main logic file + boot portal
│├──conf # profile directory
│ │  ├──__init__.py
││└──settints.py # Configuration File directory
││
│├──core# Main program directory
││├──__init__.py
││├──manager.py # Manager Class
││├──client.py# client class
││├── server.py# Server class
││└──utilities_module.py# Common module (login authentication, user file serialization)
│├──database# user Information Data directory
││├──admin.json # Admin user data
││└──xxx.json# XXX user Information Data directory
│├──home # home Directory--store user files
││├──wenjie
││└──alex # User Files--
││
│└── Server_data # server-side Data file directory
│├──share
│└──upload
└──readme


Third, process, program (see annex)

Iv. operational matters of the program
1, run server.py and then run start.py
2. Admin: admin 123 {"name": "admin", "password": "202cb962ac59075b964b07152d234b70"}
3. User Wenjie 123 {"username": "Wenjie", "Password": "202cb962ac59075b964b07152d234b70", "Size": "10M"}
Alex 123 {"username": "Alex", "Password": "202cb962ac59075b964b07152d234b70", "Size": "10M"}
4. Command Help:

LS--Print the current directory (LS after the parameter, directly print the current directory file)
CD--Switch directory (CD must be followed directory parameter: XXX user \xxx file)
mkdir--Create folder (mkdir directory name)
Get--Download (Get access to target file directory: Server_data\ file)
Put--Upload (Put file-server_data\ directory)
Quit--Return to superiors



V. Summary

1, most of the basic implementation of the function, multi-user concurrency, the continuation of the breakpoint is not implemented
2, the completion of the job did not meet expectations, left a lot of problems, the actual development process is still very slow, a lot of knowledge points in the use of unskilled

Six, the Code

Follow-up announcement cloud disk address

PYTHON-FTP Program

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.