Open Source Content Management Framework

PHP midgard_blob method read_content

  1. Example

Read content of the file which is associated with attachment.

string read_content(void);

midgard_blob method read_content takes no parameters.

This method returns file's content. Internally it tries to detect if file is binary and sets correct encoding ( UTF-8 ) for no binary files. NULL is returned if content can not be read from file.

It's not recommended to read content from large files. In such case get_handler method should be used to get file handler.

Example

<?php

$attachment = new midgard_attachment($guid);
$blob = new midgard_blob($attachment);
$content = $blob->read_content(); 

?>

More details about fails can be found in [midgard-core docs][0].

Tagged
ragnaroek
vinland
Designed by Nemein, hosted by Kafit