@expose('/api/file/')
def api_file_view(self):
    pk = request.args.get('id')
    coll = request.args.get('coll')
    db = request.args.get('db', 'default')
    if ((not pk) or (not coll) or (not db)):
        abort(404)
    fs = gridfs.GridFS(get_db(db), coll)
    data = fs.get(self.object_id_converter(pk))
    if (not data):
        abort(404)
    return Response(data.read(), content_type=data.content_type, headers={'Content-Length': data.length})
@expose('/api/file/')
def api_file_view(self):
    pk = request.args.get('id')
    coll = request.args.get('coll')
    db = request.args.get('db', 'default')
    if ((not pk) or (not coll) or (not db)):
        abort(404)
    fs = gridfs.GridFS(get_db(db), coll)
    data = fs.get(self.object_id_converter(pk))
    if (not data):
        abort(404)
    return Response(data.read(), content_type=data.content_type, headers={'Content-Length': data.length})