【发布时间】:2012-05-24 18:04:41
【问题描述】:
我目前正在开发一个脚本,该脚本需要使用 GridFS 将图像存储到 Mongo 中,尽管在检索文件时(使用 php 标头),width="" 和 height="" HTML 已经放置在显示器中,是有什么办法可以更改或将其存储在 Mongo/GridFS 中?
// get GridFS files collection
$grid = $db->getGridFS();
// retrieve file from collection
$file = $grid->findOne(array('_id' => new MongoId('4fb437dbee3c471b1f000001')));
// send headers and file data
header('Content-Type: image');
echo $file->getBytes();
exit;
【问题讨论】:
标签: php html mongodb gridfs nosql