saving picture to mongodb

后端 未结 5 796
花落未央
花落未央 2020-11-30 06:23

am trying yo do this using tornado and pil and mongodb.

avat = self.request.files[\'avatar\'][0][\"body\"]
nomfich = s         


        
5条回答
  •  春和景丽
    2020-11-30 07:05

    You need to save binary data using the Binary() datatype of pymongo.

    http://api.mongodb.org/python/2.0/api/bson/binary.html#module-bson.binary

提交回复
热议问题