#! /usr/bin/env python

import socket
import sys

if len(sys.argv) < 2:
    print('Please input file name')
    exit(-1)

file_name = sys.argv[1]

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('121.43.180.176',8081))

with open(file_name, mode='rb+') as f:
    while True:
        buf = f.read(4096)
        if not buf:
            break
        client.send(buf)

client.close()
exit()
