Exemple #1
0
 def files(self):
     if self.env['REQUEST_METHOD'] != 'POST':
         return {}
     if not self.env.get('CONTENT_TYPE', '') .startswith('multipart/form-data'):
         return {}
     content_type = self.env.get('CONTENT_TYPE', '')
     boundary = content_type.split('boundary=', 1)[1]
     post, files = util.parse_multipart(self.__raw_data, boundary)
     return files
Exemple #2
0
 def post_args(self):
     """ Return the parsed post arguments of the request"""
     ## multipart/form-data
     if self.env.get('CONTENT_TYPE', '').startswith('multipart/form-data'):
         content_type = self.env.get('CONTENT_TYPE', '')
         boundary = content_type.split('boundary=', 1)[1]
         post, files = util.parse_multipart(self.__raw_data, boundary)
         return post
     ## normal post submission
     return util.parse_post_vars(self.__raw_data)