def prepare(self): if self.request.method != 'POST': respond_error(self, 405, 'Method not allowed') return audit_name = get_audit_name_from_request(self) file_upload_feature = self.application.file_upload_feature upload_folder = file_upload_feature.prepare_new_folder(audit_name) self.request.connection.set_max_body_size(self.application.max_request_size_mb * BYTES_IN_MB) self.form_reader = StreamingFormReader(self.request.headers, upload_folder)
def _create_reader(request): return StreamingFormReader(request.headers, _UPLOADS_FOLDER)