I'm currently writing a server-client application that need to transfer some file to work. I'm using this method:
client:
file_to_send = raw_input(">")
try:
f = open("./sent_files/" + file_to_send, "rb")
except IOError, e:
print ">error: ", e
break
data = xmlrpclib.Binary(f.read())
if s.receive_file(file_to_send, data):
print ">file correctly sent"
server:
def receive_file(self, name, arg):
with open("./sampletest/"+name, "wb") as handle:
handle.write(arg.data)
But how can I do the opposite (I mean sending a file from the server to the client) ?