Andy McKay wrote:
J Cameron Cooper wrote:
You can get the main contents of a File with the 'data' attribute. It
returns a string.
I think it actually returns an object (for large file support), if you
want the data as a string you need to string it.
So for small files:
datastr = str(context.fileObject.data)
Should work.
Yes, forgot that caveat. For large files, 'data' can return a "Pdata", a
list of strings. For small files, it returns a string. Always doing
'str' is a good idea.
--jcc
--
"Building Websites with Plone"
http://plonebook.packtpub.com/
Enfold Systems, LLC
http://www.enfoldsystems.com
_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )