mongo_gridfile_write
(PECL mongo >= 0.8.0)
mongo_gridfile_write — Write a file from the database to the local filesystem
Descrição
int mongo_gridfile_write
( resource $gridfile
, string $filename
)
Write a file from the database to the local filesystem.
Parâmetros
- gridfile
-
The grid file.
- filename
-
Name to save the file under.
Valor Retornado
Returns the number of bytes written.
Exemplos
Exemplo #1 mongo_gridfile_write() example
This example shows a file being retrieved from the database and saved to the local filesystem.
<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
// create a new grid connection
$gridfs = mongo_gridfs_init($conn, "blog", "fs");
// query for the filename
$file = mongo_gridfs_find($gridfs, array("filename" => "profilePic.jpg"));
mongo_gridfile_write($file, "pic.jpg");
?>
User Contributed Notes
mongo_gridfile_write
mongo_gridfile_write
There are no user contributed notes for this page.

mongo_find_one