MongoGridFSCursor::__construct

(PECL mongo >=0.9.0) Create a new cursor public MongoGridFSCursor::__construct ( MongoGridFS $gridfs, resource $connection, string $ns, array $query, array $fields ) Parameters: gridfs Related GridFS collection. connection Database connection. ns Full name of database and collection.

MongoGridFSFile::write

(PECL mongo >=0.9.0) Writes this file to the filesystem public int MongoGridFSFile::write ([ string $filename = NULL ] ) Parameters: filename The location to which to write the file. If none is given, the stored filename will be used. Returns: Returns the number of bytes written. Examples:

MongoGridFSFile::getSize

(PECL mongo >=0.9.0) Returns this file's size public int MongoGridFSFile::getSize ( void ) Returns: Returns this file's size

MongoGridFSFile::getResource

(PECL mongo >=1.3.0) Returns a resource that can be used to read the stored file public resource MongoGridFSFile::getResource ( void ) This method returns a stream resource that can be used with all file functions in PHP that deal with reading files. 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 lo

MongoGridFSFile::getFilename

(PECL mongo >=0.9.0) Returns this file's filename public string MongoGridFSFile::getFilename ( void ) Returns: Returns the filename.

MongoGridFSFile::getBytes

(PECL mongo >=0.9.0) Returns this file's contents as a string of bytes public string MongoGridFSFile::getBytes ( void ) Warning: this will load the file into memory. If the file is bigger than your memory, this will cause problems! Returns: Returns a string of the bytes in the file. Examples: MongoGridFSFile::getBytes() example

MongoGridfsFile::__construct

(PECL mongo >=0.9.0) Create a new GridFS file public MongoGridfsFile::__construct ( MongoGridFS $gridfs, array $file ) Parameters: gridfs The parent MongoGridFS instance. file A file from the database. Returns: Returns a new MongoGridFSFile.

MongoGridFS::storeUpload

(PECL mongo >=0.9.0) Stores an uploaded file in the database public mixed MongoGridFS::storeUpload ( string $name [, array $metadata ] ) Parameters: name The name of the uploaded file(s) to store. This should correspond to the file field's name attribute in the HTML form. metadata Other metadata fields to include in the file document.

MongoGridFS::storeFile

(PECL mongo >=0.9.0) Stores a file in the database public mixed MongoGridFS::storeFile ( string|resource $filename [, array $metadata = array() [, array $options = array() ]] ) Parameters: filename Name of the file or a readable stream to store. metadata Other metadata fields to include in the file document. Note: These fields ma

MongoGridFS::storeBytes

(PECL mongo >=0.9.2) Stores a string of bytes in the database public mixed MongoGridFS::storeBytes ( string $bytes [, array $metadata = array() [, array $options = array() ]] ) Parameters: bytes String of bytes to store. metadata Other metadata fields to include in the file document. Note: These fields may also overwrite those tha