Friday 04 July 2008 4:17:20 am
eZHTTPFile is indeed not what you need in your case. You are actually trying to access a file that is a part of a content object.
So first of all, you need to fetch the object in some way. Once you have it, you'll have an instance of the eZContentObject class. Objects of that class have a method called <i>dataMap</i>. That method returns an array with the following structure:
- key: identifier of the attribute as specified in the content class - value: instance of eZContentObjectAttribute The class eZContentObjectAttribute actually (for the real data at least) wraps around the datatype. If you query the eZContentObjectAttribute instance for content(), you will get the content that has been stored by the corresponding datatype. That content can be a scalar value, an array or even an object of class. The latter is the case for attributes of the type file. The datatype for files is called ezbinaryfile (kernel/classes/datatypes) and the content of that datatype returns an instance of the class eZBinaryFile. That should get you on the road. I obviously left some things out, but the goal is that you actually learn something. So it's your task to connect the dots ;-) hth
Hans
http://blog.hansmelis.be
|