def METHOD_NAME(request):
    try:
        return request._instance_and_attachment
    except AttributeError:
        pass
    attachments = {}
    if request.META['CONTENT_TYPE'].startswith('multipart/form-data'):
        # ODK submission; of the form
        # $ curl --form 'xml_submission_file=@form.xml' $URL
        if list(request.POST):
            raise MultimediaBug("Received a submission with POST.keys()")
        try:
            instance_file = request.FILES[MAGIC_PROPERTY]
        except MultiValueDictKeyError:
            raise MultipartFilenameError()
        else:
            if instance_file.size > settings.MAX_UPLOAD_SIZE:
                logging.info("Domain {request.domain} attempted to submit a form exceeding the allowed size")
                raise PayloadTooLarge()
            if not _valid_instance_file_extension(instance_file):
                raise InvalidSubmissionFileExtensionError()
            instance = instance_file.read()
            for key, item in request.FILES.items():
                if key != MAGIC_PROPERTY:
                    if _attachment_exceeds_size_limit(item):
                        raise AttachmentSizeTooLarge()
                    if not _valid_attachment_file(item):
                        raise InvalidAttachmentFileError()
                    attachments[key] = item
        if not instance:
            raise MultipartEmptyPayload()
    else:
        # touchforms; of the form
        # $ curl --data '@form.xml' $URL
        instance = request.body
        if not instance:
            raise EmptyPayload()
    request._instance_and_attachment = (instance, attachments)
    return instance, attachments