InputStream anInputStream;
if (request.formValueForKey(FormKeys.qqfilename) != null) {
aFileName = (String) request.formValueForKey(FormKeys.qqfilename);
NSData data = (NSData) request.formValueForKey(FormKeys.qqfile);
anInputStream = data.stream();
} else if (request.formValueForKey(FormKeys.qqfile) != null) {
aFileName = (String) request.formValueForKey(FormKeys.qqfile);
anInputStream = (request.contentInputStream() != null) ? request.contentInputStream() : request.content().stream();
} else {
log.error("Unable to obtain filename from form values: " + request.formValueKeys());