Answered Essay: hello guys. I need your help. I just learned python and I need a guidance for my programming projects.

hello guys. I need your help. I just learned python and I need a guidance for my programming projects.

—————————————————————————————————————————————–

This assignment must be done in Python 3

In this assignment, you will write a client and server application similar to FTP. The client connects to the server and can down-load any file accessible to the server application. Any number of files can be down-loaded and no access control is performed.

More specifically, the client initiates a control connection to the server port (the default port is #5000 if a port number is not given). All commands are sent over this connection. The client supported commands are: listget, and exit. The client will request a list of file names that are available on the server, (list of files in the same directory as the server.py file). The client can ‘get’ a file by entering ‘get filename.ext’. When the client requests to down-load a file using get, the server sends the requested file back. After the client receives the file and saves it to disk, the user should be able to issue another listget or exit command.

Additional requirements:

1.) The client will need to verify that it received the entire file. (Therefore, the server must let the client know the file size before sending it).

a.)The server message will be the in the following format:

‘sending filename.ext size (The size in bytes)’

2.) All connections must be properly closed when the client is finished, i.e. sends: exit.

3.)The server must be able to handle simultaneous requests from multiple clients. (Threads can be used)

4.)The client may ask for a file that the server cannot provide, so the client must be able to respond appropriately with an error message (since the client can obtain a list of files). (No crashing!)

5.)Do not assume a file size, i.e. send the file in chunks of 1024 bytes.

6.)Do not assume ‘localhost’.

7.)The client should put the received file in the same directory as the client.py file (The client.py file could be on a different host).

8.)Test your client and server with other students to see if you have made any assumptions.

9.)If your program does not completely work, it should not crash, the user should receive the message ‘Not Implemented Yet’.

10.) Do not hardcode any port numbers or IP addresses for the client. I should be able to provide the server and port number for the client side using command line arguments. Example: client.py 129.32.56.2 12001

11.)Do no hardcode any port numbers for the server. To run the program, I will type python3 server.py port_number (or python3 server.py) and python3 client.py ipaddress port_number

12.) Don’t do anything that would make your code specific to an operating system, such as windows pathnames, or Unix pathnames.

Submission Instructions:

1.)Turn in 3 files server.py, client.py and README.txt, zipped with your last_name.zip as the title of the assignment. DO NOT ADD ANYTHING ELSE TO THE ZIP FILE NAME.

2.)All functions and variables should have meaningful names.

3.)Use meaningful comments for functions

4.)I will place 3 files, .txt, .jpg, .png in the server directory when I unzip your submission. I will run the server and clients on different machines, so test your applications similarly. (Use Pickle to send objects back and forth, such as lists and non-string objects.)

5.)I will initiate several of your clients at the same time. You should test this also.

6.)The README.txt should:

a.)Let me know if your program is not fully implemented.

b.)Identify whether you developed the application on a Windows, MAC or Unix machine.

c.)Include specific instructions to type on the command line to run your program.

d.)Forewarn of any implementation issues

Expert Answer

pip install pyftpdlib

ftp-server.py:

from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer

authorizer = DummyAuthorizer()
authorizer.add_user("user", "12345", "/home/username", perm="elradfmw")
authorizer.add_anonymous("/home/username", perm="elradfmw")

handler = FTPHandler
handler.authorizer = authorizer

server = FTPServer(("127.0.0.1", 1026), handler)
server.serve_forever()

replace username with your’s

keep in mind that the port number should be greater than 1024 or it will throw an error “socket.error: [Errno 13] Permission denied” because you can’t bind to a port lower than 1024 as you don’t have that right.

for client we are using ftplib module from the official python library

ftp-client.py:

from ftplib import FTP

ftp = FTP('')
ftp.connect('localhost',1026)
ftp.login()
ftp.cwd('directory_name') #replace with your directory
ftp.retrlines('LIST')

def uploadFile():
 filename = 'testfile.txt' #replace with your file in your home folder
 ftp.storbinary('STOR '+filename, open(filename, 'rb'))
 ftp.quit()

def downloadFile():
 filename = 'testfile.txt' #replace with your file in the directory ('directory_name')
 localfile = open(filename, 'wb')
 ftp.retrbinary('RETR ' + filename, localfile.write, 1024)
 ftp.quit()
 localfile.close()

uploadFile()
#downloadFile()

Note that the port number and ip should be same as the server’s.

Now, run the server script first and then the client script

python ftp-server.py
python ftp-client.py
Buy Essay
Calculate your paper price
Pages (550 words)
Approximate price: -

Help Me Write My Essay - Reasons:

Best Online Essay Writing Service

We strive to give our customers the best online essay writing experience. We Make sure essays are submitted on time and all the instructions are followed.

Our Writers are Experienced and Professional

Our essay writing service is founded on professional writers who are on stand by to help you any time.

Free Revision Fo all Essays

Sometimes you may require our writers to add on a point to make your essay as customised as possible, we will give you unlimited times to do this. And we will do it for free.

Timely Essay(s)

We understand the frustrations that comes with late essays and our writers are extra careful to not violate this term. Our support team is always engauging our writers to help you have your essay ahead of time.

Customised Essays &100% Confidential

Our Online writing Service has zero torelance for plagiarised papers. We have plagiarism checking tool that generate plagiarism reports just to make sure you are satisfied.

24/7 Customer Support

Our agents are ready to help you around the clock. Please feel free to reach out and enquire about anything.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

HOW OUR ONLINE ESSAY WRITING SERVICE WORKS

Let us write that nagging essay.

STEP 1

Submit Your Essay/Homework Instructions

By clicking on the "PLACE ORDER" button, tell us your requires. Be precise for an accurate customised essay. You may also upload any reading materials where applicable.

STEP 2

Pick A & Writer

Our ordering form will provide you with a list of writers and their feedbacks. At step 2, its time select a writer. Our online agents are on stand by to help you just in case.

STEP 3

Editing (OUR PART)

At this stage, our editor will go through your essay and make sure your writer did meet all the instructions.

STEP 4

Receive your Paper

After Editing, your paper will be sent to you via email.