asyncgridfsMongoDB GridFS 开发库
Tornado 非阻塞的 MongoDB GridFS 开发库
示例代码:
import asyncmongo import tornado.web from asyncgridfs import GridFS class Handler(tornado.web.RequestHandler): @property def db(self): if not hasattr(self, '_db'): self._db = asyncmongo.Client(pool_id='mydb', host='127.0.0.1', port=27017, maxcached=10, maxconnections=50, dbname='test') return self._db @tornado.web.asynchronous def get(self): fid = self.get_argument('fid') fs = GridFS(self.db) fs.get(ObjectId(fid),callback=self._on_get) @tornado.web.asynchronous def post(self): f = self.request.files['imgFile'][0] content = f.pop('body') content_type = f.pop('content_type') filename = f.pop('filename') fs = GridFS(self.db) fs.put(content, contentType=content_type, filename=filename, callback=self._on_post) def _on_get(self, fileobj): self.set_header('Content-Type', fileobj['contentType']) self.write(fileobj['data']) self.finish() def _on_put(self, _id): self.write(str(_id)) self.finish()
评论
GridFS FUSE围绕 MongoDB GridFS 的 FUSE 封装器
GridFS FUSE 允许你将一个 MongoDB GridFS 实例安装成本地的文件系统。环境要
GridFS FUSE围绕 MongoDB GridFS 的 FUSE 封装器
0
GridFS FUSE围绕 MongoDB GridFS 的 FUSE 封装器
GridFSFUSE允许你将一个MongoDBGridFS实例安装成本地的文件系统。环境要求:MongoDB1.6+FUSEBoost使用方法:$ ./mount_gridfs --db=db_nam
GridFS FUSE围绕 MongoDB GridFS 的 FUSE 封装器
0
WslayWebSocket 开发库
Wslay是一个用C语言实现的WebSocket开发库。实现了RFC6455中描述的第13版本的协议。提供了基于事件的API和基于帧的底层API。特别适合非堵塞的reactor模式风格应用。可在不同的
WslayWebSocket 开发库
0
oSIPSIP开发库
oSIP是遵循IETF标准,使用ANSIC编写,源代码开放的SIP协议栈。oSIP开发库是第一个自由软件项目。在第三代网络体系中,越来越多的电信运营商将要使用IP电话(Linux也成为支撑平台的幸运儿
oSIPSIP开发库
0
riskiqpython 开发库
riskiq是RiskIQRESTAPI库。它能将Python库转换成RiskIQAPI服务它具有以下特征:PassiveDNSqueriesBlacklistURLsearchBlacklistIn
riskiqpython 开发库
0
AnimationPackageActionScript开发库
AnimationPackage是一个ActionScript库,兼容FlashPlayer6以及更新版本的播放器,可帮助你用来轻松的创建强大、可维护的Flash动画,生成的Flash动画文件体积很小
AnimationPackageActionScript开发库
0