©
이 문서에서는 PHP 중국어 웹사이트 매뉴얼 풀어 주다
(PECL mongo >=0.9.0)
MongoGridFSFile::getBytes — Returns this file's contents as a string of bytes
Warning: this will load the file into memory. If the file is bigger than your memory, this will cause problems!
此函数没有参数。
Returns a string of the bytes in the file.
Example #1 MongoGridFSFile::getBytes() example
<?php
$images = $db -> my_db -> getGridFS ( 'images' );
$image = $images -> findOne ( 'jwage.png' );
header ( 'Content-type: image/png;' );
echo $image -> getBytes ();
?>