def SendFile(client, addr, filename): if not os.path.exists(filename): print(FileExistsError) return client.send(b'\x02') client.send(caps.Fill(encrypt.BytesEncode(addr), 18)) _SendDataSmall(client, encrypt.BytesEncode(filename)) data = open(filename, 'rb').read() SendData(client, data, True)
def SendFile(client, filename): if not os.path.exists(filename): print(FileExistsError) return client.send(b'\x02') _SendDataSmall(client, encrypt.BytesEncode(filename)) data = open(filename, 'rb').read() SendData(client, data, True) print("sent %s with size of %s bytes" % (filename, len(data)))
def SendString(client, addr, string): client.send(b'\x01') client.send(caps.Fill(encrypt.BytesEncode(addr), 18)) SendData(client, encrypt.BytesEncode(string))
def SendFolder(client, foldername): client.send(b'\x03') _SendDataSmall(client, encrypt.BytesEncode(foldername))
def SendString(client, string): client.send(b'\x01') SendData(client, encrypt.BytesEncode(string))