downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MongoGridFSFile::getSize> <MongoGridFSFile::getFilename
[edit] Last updated: Fri, 23 Mar 2012

view this page in

MongoGridFSFile::getResource

(Bir sürüm bilgisi bulunamadı; sadece SVN'de olabilir.)

MongoGridFSFile::getResourceReturns a resource that can be used to read the stored file

Açıklama

public stream MongoGridFSFile::getResource ( void )

This method returns a stream resource that can be used with all file functions in PHP. The contents of the file are pulled out of MongoDB on the fly, so that the whole file does not have to be loaded into memory first.

At most two GridFSFile chunks will be loaded in memory.

Değiştirgeler

Bu işlevin değiştirgesi yoktur.

Dönen Değerler

Returns a resource that can be used to read the file with

Örnekler

Örnek 1 MongoGridFSFile::getResource() example

<?php
$m 
= new Mongo;
$images $m->my_db->getGridFS('images');

$image $images->findOne('mongo.png');

header('Content-type: image/png;');
$stream $image->getResource();

while (!
feof($stream)) {
    echo 
fread($stream8192);
}
?>


add a note add a note User Contributed Notes MongoGridFSFile::getResource
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites