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::write() example
<?php

$images = $db->my_db->getGridFS('images');

$image = $images->findOne('jwage.png');
$image->write('/path/to/write/jwage.png');
?>

doc_php
2016-02-24 16:20:54
Comments
Leave a Comment

Please login to continue.