### Describe the bug

While the toFormData is ready to receive a FileList, the function tries to iterate it over a normal forEach which leads to a

```
TypeError: arr.forEach is not a function
    at FormData.defaultVisitor (toFormData.js:157:1)
    at each (toFormData.js:184:1)
    at Object.forEach (utils.js:256:1)
    at build (toFormData.js:183:1)
    at toFormData (toFormData.js:194:1)
    at Object.transformRequest (index.js:71:1)
    at transform (transformData.js:21:1)
    at Object.forEach (utils.js:247:1)
    at Object.transformData (transformData.js:20:1)
    at Axios.dispatchRequest (dispatchRequest.js:38:1)
```

![image](https://user-images.githubusercontent.com/5560268/215735279-07b514f6-d8dc-4def-9632-14f86481647c.png)


### To Reproduce

Add a file input to the form and try to submit:
```
const FormFileInput = (props: FormFileInputProps) => {
  const { control, name, multiple } = props;
  const { field } = useController({ control, name });
  const [value, setValue] = React.useState('');
  return (
    <input
      type="file"
      value={value}
      onChange={(e) => {
        setValue(e.target.value);
        field.onChange(e.target.files);
      }}
    />
  );
};
```

Error should appear both on a single or multiple file upload.

### Code snippet

_No response_

### Expected behavior

The FileList should be iterated:

`Array.prototype.forEach.call(arr, function(file) { ... });`

### Axios Version

1.2.6

### Adapter Version

_No response_

### Browser

Edge

### Browser Version

109.0.1518.61

### Node.js Version

_No response_

### OS

_No response_

### Additional Library Versions

```bash
React 18.2.0
React-Hook-Form 7.40.0
```


### Additional context/Screenshots

_No response_
lib/helpers/toFormData.js
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
}
/**
 * It takes a path, a key, and a boolean, and returns a string
 *
 * @param {string} path - The path to the current key.
 * @param {string} key - The key of the current object being iterated over.
 * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
 *
 * @returns {string} The path to the current key.
 */
function renderKey(path, key, dots) {
  if (!path) return key;
  return path.concat(key).map(function each(token, i) {
    
    token = removeBrackets(token);
    return !dots && i ? '[' + token + ']' : token;
  }).join(dots ? '.' : '');
}
/**
 * If the array is an array and none of its elements are visitable, then it's a flat array.
 *
 * @param {Array<any>} arr - The array to check
 *
 * @returns {boolean}
 */
function isFlatArray(arr) {