无法通过 xmlrpc 将图像上传到 Plone 2.5
基于Zope2 XML-RPC之间的不良交互的答案和 AT Image mutator? 我希望能够使用 Plone 2.5 执行以下操作:
proxy = xmlrpclib.ServerProxy('http://admin:admin@localhost:8080/Plone/screenshot.png', verbose=True)
wrappedData = xmlrpclib.Binary(open(filename).read())
proxy.setImage(wrappedData)
相反,我得到了一个回溯(来自 Archetypes):
Value is not File or String ( - xmlrpclib.Binary)\n</string></value>\n</member>\n</struct></value>\n</fault>\n</methodResponse>\n
我怀疑我已经做了一些事情AT不高兴,但我不知道是什么。回溯来自 Archetypes field.py 的第 897 行,您可以在这里看到:
有人知道这是怎么回事吗?完整的代码示例也在这里:
Based on the answer to Bad interaction between Zope2 XML-RPC and AT Image mutator? I'd expect to be able to do the following with Plone 2.5:
proxy = xmlrpclib.ServerProxy('http://admin:admin@localhost:8080/Plone/screenshot.png', verbose=True)
wrappedData = xmlrpclib.Binary(open(filename).read())
proxy.setImage(wrappedData)
Instead, I get a traceback (from Archetypes):
Value is not File or String ( - xmlrpclib.Binary)\n</string></value>\n</member>\n</struct></value>\n</fault>\n</methodResponse>\n
I suspect I've done something to make AT unhappy, but I'm not sure what. The traceback comes from line 897 of Archetypes's field.py, which you can see here:
Anyone know what's going on here? Also full code example is here:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有了这个补丁,它就像一个魅力:
With this patch it works like a charm: