Hi,
2. I have tried using pure Python code but I get the same exception:
xmlrpclib.Fault: <Fault -1: 'Unexpected Zope exception: exceptions.IndexError -
list index out of range'>
1. I have tried with a CPS File field and the xmlrpc client doesn't return any
exception, the object is created and the binary assigned but when I try to see
the new document in the browser I get the following exception:
Error Type:AttributeError
Error Value:Binary instance has no attribute 'size'
Traceback:Traceback (innermost last):
* Module ZPublisher.Publish, line 115, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 41, in call_object
* Module Shared.DC.Scripts.Bindings, line 311, in __call__
* Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
* Module Products.CMFCore.FSPageTemplate, line 195, in _exec
* Module Products.CMFCore.FSPageTemplate, line 134, in pt_render
* Module Products.PageTemplates.PageTemplate, line 104, in pt_render
________________________________
I suggest to try to simplify the problem to find where the problem is.
1. First could you please validate if creating a File field works
for you? If this works that could mean that the encoding of binary
data is not the cause of the problem.
2. Another try would be to test the creation of your document from pure
Python code as is specified in the CPSRemoteController doc:
from xmlrpclib import ServerProxy, Binary
f = open('MyImage.png', 'r')
binary = Binary(f.read())
p.createDocument('MySpecialZipFile',
{'Title': "The report from Monday meeting",
'Description': "Another boring report"},
'file_name': "MyImage.png",
'file_key': 'file_zip',
'file': binary,
},
'workspaces')
And please when having an error, could you please also send
the stacktrace from the server, as there should be one.
Cheers,
--
Marc-Aurèle DARCHE
AFUL http://www.aful.org/
Association Francophone des Utilisateurs de Logiciels Libres
French speaking Libre Software Users' Association
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel