Skip to content

Instantly share code, notes, and snippets.

@deepal
Created October 28, 2015 22:28
Show Gist options
  • Save deepal/d68f9208d3a3638e4b89 to your computer and use it in GitHub Desktop.
Save deepal/d68f9208d3a3638e4b89 to your computer and use it in GitHub Desktop.
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