def get_post_data(self, request):
        """
        Collect and merge post parameters with multipart files.
        """
        params = dict(request.POST)
        params.update(request.FILES)

        data = defaultdict(dict)

        # Split data and meta parameters
        for param in sorted(params.keys()):
            value = params[param]

            if isinstance(value, list) and len(value) <= 1:
                value = value[0] if value else None

            prefix, _, field = param.partition('[')
            if field:
                field = field[:-1]
                try:
                    data[prefix][field] = value
                except TypeError:
                    raise InvalidNodeData('Got both reserved parameter "data" and plugin specific parameters.')
            else:
                data[prefix] = value

        return data['data'], data['meta']
Collect and merge post parameters with multipart files.