am trying yo do this using tornado and pil and mongodb.
avat = self.request.files[\'avatar\'][0][\"body\"] nomfich = s
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