FileInput doesn't accept multiple files when setting 'multiple' property using options prop
What you were expecting: A FileInput that accepts multiple files.
What happened instead: The input only accepts a single file.
Steps to reproduce:
Set multiple using the options prop rather than the multiple prop.
From the docs:
The FileInput component accepts an options prop into which you can pass all the react-dropzone properties. For instance, if you need to upload several files at once, just add the options={{ multiple: true }} DropZone attribute to your
field.
Related code:
<FileInput source="files" options={{ multiple: true }}>
<FileField source="src" title="title" />
</FileInput>
Other information: I will create a pull request for FileInput to check the options prop in addition to the (legacy?) multiple prop. Otherwise, we should update the documentation to mention the multiple prop.
Environment
- React-admin version: 2.2.0
Try this , It worked for me. It will return array of raw files
<FileInput source="files" multiple = {true} >
<FileField source="src" title="title" />
</FileInput>