protected function process($field, array $settings, EntityInterface $entity, ProfferPathInterface $path = null)
    {
        $path = $this->createPath($entity, $field, $settings, $path);

        if (is_array($entity->get($field)) && count(array_filter(array_keys($entity->get($field)), 'is_string')) > 0) {
            $uploadList = [$entity->get($field)];
        } else {
            $uploadList = [
                [
                    'name' => $entity->get('name'),
                    'type' => $entity->get('type'),
                    'tmp_name' => $entity->get('tmp_name'),
                    'error' => $entity->get('error'),
                    'size' => $entity->get('size'),
                ]
            ];
        }

        foreach ($uploadList as $upload) {
            if ($this->moveUploadedFile($upload['tmp_name'], $path->fullPath())) {
                $entity->set($field, $path->getFilename());
                $entity->set($settings['dir'], $path->getSeed());

                $this->createThumbnails($entity, $settings, $path);
            } else {
                throw new CannotUploadFileException("File `{$upload['name']}` could not be copied.");
            }
        }

        unset($path);
    }