xmlrpclib.binary to a file doubt

Jose Ignacio Gisbert jigisbert.etra-id at grupoetra.com
Wed Dec 12 10:48:54 EST 2007


I have resolved my problem!, I think it is easy for everyone, but I unknown
“data” binary object attribute. So, code for store a file that is passed as
a binary object would be:

file = calltoreceivemethod()

placetostore=open(filename,'wb')

data=file.data

placetostore.write(data)

 

Regards,

Naxo

 

  _____  

De: python-list-bounces+jigisbert.etra-id=grupoetra.com at python.org
[mailto:python-list-bounces+jigisbert.etra-id=grupoetra.com at python.org] En
nombre de Jose Ignacio Gisbert
Enviado el: miércoles, 12 de diciembre de 2007 9:12
Para: python-list at python.org
Asunto: xmlrpclib.binary to a file doubt

 

Hi all,

 

I have a problem in my application which uses xml-rpc methods. From one hand
I can send a file to a server doing 

 

f=open(Myfile,'rb')

g=f.read()

name=(f.name).split("/")

name=name[len(name)-1]

calltosendmethod(xmlrpclib.Binary(g),name)

 

And it works fine. But on the other hand I have to get a document from the
server, which method returns document content in xmlrpclib.binary format,
and I am not able to store it on a local file. If somebody knows how to,
please tell me something, anything will helps. 

 

Thanks in advance, 

_______________________________
José Ignacio Gisbert Sanus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071212/faba75a1/attachment.html>


More information about the Python-list mailing list