def METHOD_NAME(request):
    """
    Handle request.FILES if len(request.FILES) == 1.
    Returns tuple(upload, filename, is_raw, mime_type) where upload is file itself.
    """
    # FILES is a dictionary in Django but Ajax Upload gives the uploaded file
    # an ID based on a random number, so it cannot be guessed here in the code.
    # Rather than editing Ajax Upload to pass the ID in the querystring,
    # note that each upload is a separate request so FILES should only
    # have one entry.
    # Thus, we can just grab the first (and only) value in the dict.
    is_raw = False
    upload = list(request.FILES.values())[0]
    filename = upload.name
    _, iext = os.path.splitext(filename)
    mime_type = upload.content_type.lower()
    extensions = mimetypes.guess_all_extensions(mime_type)
    if mime_type != 'application/octet-stream' and extensions and iext.lower() not in extensions:
        msg = "MIME-Type '{mimetype}' does not correspond to file extension of {filename}."
        raise UploadException(msg.format(mimetype=mime_type, filename=filename))
    return upload, filename, is_raw, mime_type