protected function autoUpload()
    {
        foreach ($this->getDefinedUploadFields() as $key => $val) {
            $field = is_int($key) ? $val : $key;
            $options = array_wrap($val);

            // check if global upload is allowed, then in override in option
            $autoUploadAllowed = array_get($options, 'auto_upload', $this->canAutoUploadImages());

            if (!$autoUploadAllowed) {
                continue;
            }

            // get the input file name
            $requestFileName = array_get($options, 'file_input', $field);

            // if request has the file upload it
            if (request()->hasFile($requestFileName)) {
                $this->uploadImage(
                    request()->file($requestFileName),
                    $field
                );
            }
        }
    }