def prepare(self): if self.request.method.upper() == 'POST': if 'expected_size' in self.request.arguments: self.request.connection.set_max_body_size( int(self.get_argument('expected_size'))) try: total = int(self.request.headers.get("Content-Length", "0")) except KeyError: total = 0 self.multipart_streamer = MultiPartStreamer(total)
def prepare(self): if self.request.method.lower() == "post": # Set this request's max_body_size to 20 GB self.request.connection.set_max_body_size(20 * self.GB) try: total = int(self.request.headers.get("Content-Length", "0")) except KeyError: total = 0 self.ps = MultiPartStreamer(total) print 'Upload Video Prepared'