Created
October 28, 2015 22:28
-
-
Save deepal/d68f9208d3a3638e4b89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def startClient(): | |
from ftplib import FTP | |
thread.start_new_thread(validation_server, (TCP_CON_PORT,)) | |
hostname = sys.argv[2] | |
ftp = FTP(hostname) | |
ftp.login() | |
filepath = sys.argv[3] | |
encFilepath = encrypt(filepath) | |
localfile = open(encFilepath,"rb") | |
try: | |
print "[!] File Transfer in Progress...." | |
result = ftp.storbinary("STOR "+str(os.path.basename(encFilepath)),localfile) | |
except Exception as e: | |
print e | |
else: | |
print str(result) | |
os.system("rm "+encFilepath) | |
print "[!] Waiting for integrity validation..." | |
while True: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment