Can I send files through xmlrpc connections?

D

dcrespo

....If the answer is Yes, can you give me an example either in the
server side and the client side?

I googled a lot, but I can't find nothing regarding this.

A lot of thanks.

Daniel
 
F

Fredrik Lundh

dcrespo said:
...If the answer is Yes, can you give me an example either in the
server side and the client side?

I googled a lot, but I can't find nothing regarding this.

the XML-RPC specification

http://www.xmlrpc.com/spec

mentions the following data types

four-byte signed integer
boolean: 0 (false) or 1 (true)
string
double-precision signed floating point number
date/time
base64-encoded binary data
structs
arrays

file isn't in that list.

however, you can of course read the file into a variable, and send
that variable over the wire (as either a string or a binary data value,
depending on what kind of data you have in your files)

(if the files are large, you might be better off using plain HTTP)

</F>
 
D

dcrespo

I'm sorry, I didn't the right question... Of course that I can break
the file and rewrite it on an xmlrpc protocol for transmition, or send
a byte each time through the socket lib. I meant is there a program
already developed that sends and receives files based on xmlrpc calls?

Thanks.
 
F

Fredrik Lundh

dcrespo said:
I'm sorry, I didn't the right question... Of course that I can break
the file and rewrite it on an xmlrpc protocol for transmition, or send
a byte each time through the socket lib. I meant is there a program
already developed that sends and receives files based on xmlrpc calls?

I'm not sure I understand what you're trying to do, really, but here's a
program to send files based on xmlrpc calls:

import sys, xmlrpclib
xmlrpclib.ServerProxy(sys.argv[1]).store(open(sys.argv[2], "rb").read())

to receive files based on xmlrpc calls, see:

http://www.python.org/doc/2.4/lib/module-SimpleXMLRPCServer.html

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,265
Messages
2,571,317
Members
47,996
Latest member
LaurenFola

Latest Threads

Top