def process_request(self, request):
        if request.method != 'POST':
            return
        if not is_enabled():
            return
        if get_server_name() != SERVER_NGINX:
            return
        # Find uploads in request.POST and copy them to request.FILES. Such
        # fields are expected to be named as:
        # __original_field_name__[__attribute__]
        # We will build a unique list of the __original_field_name__'s we find
        # that contain a valid __attribute__ name.
        fields = set()
        for name in request.POST.keys():
            field, bracket, attr = name.partition('[')
            if attr in ('filename]', 'path]', 'size]', 'content_type]'):
                fields.add(field)
        # If we found any field names that match the expected naming scheme, we
        # can now loop through the names, and try to extract the attributes.
        # The original fields will be pop()ed off request.POST, to clean up.
        if fields:
            # We will be modifying these objects, so make them mutable.
            request.POST._mutable, request.FILES._mutable = True, True
            for field in fields:
                # Get required fields. If these are missing, we will fail.
                data = []
                try:
                    fields = enumerate(zip(request.POST.pop('%s[filename]' % field), request.POST.pop('%s[path]' % field)))
                except __HOLE__:
                    raise Exception('Missing required field "%s", please '
                                    'configure mod_upload properly')
                # Get optional fields. If these are missing, we will try to
                # determine the value from the temporary file.
                try:
                    content_types = dict(enumerate(request.POST.pop('%s[content_type]' % field)))
                except (KeyError, ValueError):
                    content_types = {}
                try:
                    sizes = dict((request.POST.pop('%s[size]' % field)))
                except (KeyError, ValueError):
                    sizes = {}
                # Iterating over possible multiple files
                for i, (name, temp) in fields:
                    content_type = content_types[i] if i in content_types else mimetypes.guess_type(name)[0]
                    size = sizes[i] if i in sizes else os.path.getsize(temp)
                    data.append(ProxyUploadedFile(temp, name, content_type, size))
                # Now add a new UploadedFile object so that the web application
                # can handle these "files" that were uploaded in the same
                # fashion as a regular file upload.
                if not data:
                    continue
                request.FILES.setlist(field, data)
            # We are done modifying these objects, make them immutable once
            # again.
            request.POST._mutable, request.FILES._mutable = False, False
dataset/ETHPy150Open smartfile/django-transfer/django_transfer/__init__.py/TransferMiddleware.process_request