def process_multipart_form_data(entity):
    """Read ``multipart/form-data`` parts.

    This function saves them into ``entity.parts`` or ``entity.params``.
    """
    process_multipart(entity)

    kept_parts = []
    for part in entity.parts:
        if part.name is None:
            kept_parts.append(part)
        else:
            if part.filename is None:
                # It's a regular field
                value = part.fullvalue()
            else:
                # It's a file upload. Retain the whole part so consumer code
                # has access to its .file and .filename attributes.
                value = part

            if part.name in entity.params:
                if not isinstance(entity.params[part.name], list):
                    entity.params[part.name] = [entity.params[part.name]]
                entity.params[part.name].append(value)
            else:
                entity.params[part.name] = value

    entity.parts = kept_parts
Read ``multipart/form-data`` parts.

    This function saves them into ``entity.parts`` or ``entity.params``.
    
cherrypy/_cpreqbody.py