Yuvaleros/material-ui-dropzone

Question: How to access the fileObjs data field from a DropzoneArea?

gaitat opened this issue · 0 comments

Question

Describe the problem

I am trying to access the data of a dropped file.
In DropzoneAreaBase.handleDropAccepted the data of a dropped file is retrieved through a readFile() call.
Those contents are returned in the onAdd() call. So if one was using a DropzoneAreaBase he would have access to the data of the dropped file.

But when using the DropzoneArea I dont see how to access that data field. When specifying an onAdd for a DropzoneArea it never gets called.
The provided onChange prop, instead of returning the fileObjects as is, it returns only the file portion of the object.

fileObjects.map((fileObject: any) => fileObject.file)

Appreciate any suggestions.

Versions

  • react version: [17.0.1]
  • material-ui-dropzone version: [e.g. 3.5.0]