UploadedForm form = request.getUploadedForm();
UploadCtx ctx = new UploadCtx(baseUrl, form, session, uploadServer);
if (hasFiles && !hasErrors) {
UploadedFile file = files.get(0);
ctx = ctx.withFile(file);
return new FirstFromRequestValid(ctx, file);
} else {
List<UploadRequestException> exceptions = closure.getExceptions();
return new FirstFromRequestInvalid(ctx, exceptions);