MongoGridFS::storeUpload
(PECL mongo >=0.9.0)
MongoGridFS::storeUpload — Saves an uploaded file to the database
Описание
public mixed MongoGridFS::storeUpload
(
string $name
[,
array $metadata
] )
<form method="POST" enctype="multipart/form-data">
Please upload a profile picture: <input type="file" name="pic"/>
<input type="submit"/>
</form>
If you wanted to store this upload in MongoDB, you could do:
<?php
$grid->storeUpload("pic", array("username" => "joe"));
?>
Note that the "name" field in HTML matches the name parameter.
Список параметров
-
name
-
The name field of the uploaded file.
-
metadata
-
An array of extra fields for the uploaded file.
Возвращаемые значения
Returns the _id of the uploaded file.