reading an uploaded file content

reading an uploaded file content

Thursday 19 June 2008 3:18:12 am - 3 replies

Author Message

Pascal Specht

Thursday 19 June 2008 5:20:20 am

Hi Alexandre,

Maybe you can find your solution by reverse-engineering what eZBinaryFileHandler does:

$fileHandler =& eZBinaryFileHandler::instance();
$result = $fileHandler->handleDownload( $contentObject, $contentObjectAttribute, EZ_BINARY_FILE_TYPE_FILE );

Hope this helps,
</Pascal>

Peretjatko Alexandre

Thursday 19 June 2008 5:35:01 am

Hi Pascal,

In your code,

if $contentObject is the value that I found in ezcontentobject table ( column ID ), what would be $contentObjectAttribute ?

Regards

Alex.
--------------------------------------------------------------
Personnal website : http://www.alex-design.fr

Pascal Specht

Thursday 19 June 2008 6:05:51 am

Hi Alexandre,

the contentObjectAttribute argument is the eZContentObjectAttribute of the ContentObject (see eZContentObjectAttribute documentation here:http://pubsvn.ez.no/doxygen/trunk/html/classeZContentObjectAttribute.html).
The code was a snipped from eZ's source code, not working out of the box.

What I meant is that you can start looking at how this has been implemented, how eZ Publish does it.

(from kernel/classes/ezbinaryfilehandler.php)

$fileInfo = $contentObjectAttribute->storedFileInformation( $contentObject, $version,
            $contentObjectAttribute->attribute( 'language_code' ) );

one typical way to get COA (ContentObjectAttributes) from a contentobject is for example:

$contentObjectAttributes =& $contentobject->contentObjectAttributes( false, false, $language, false );

</Pascal>

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.