MongoGridFS::storeFileファイルをデータベースに格納する 説明
public mixed MongoGridFS::storeFile
( stringresource
$filename
[, array $metadata = array()
[, array $options = array()
]] )パラメータ
返り値格納したファイルドキュメントの _id を返します。 エラー / 例外
例例1 MongoGridFS::storeFile でのメタデータの追加
<?php 上の例の出力は、 たとえば以下のようになります。 array(7) { ["_id"]=> object(MongoId)#6 (0) { } ["contentType"]=> string(10) "plain/text" ["filename"]=> string(11) "example.txt" ["uploadDate"]=> object(MongoDate)#7 (0) { } ["length"]=> int(26) ["chunkSize"]=> int(262144) ["md5"]=> string(32) "c3fcd3d76192e4007dfb496cca67e13b" } 参考
|