files-ui/files-ui-react

addExtraData

memcaliber opened this issue · 1 comments

i have code in react JS:
import {addExtraData } from '@files-ui/react'

how to using addExtraData , i want to send form data with uploading image to server.

I was looking for this same functionality.

The addExtraData method is an internal function to the library. What you really want is the "extraUploadData" property of an ExtFile. Add this property in DropZone.onChange and it will be sent to the server.

onDropzoneChange = (files) => {
	_.each(files, (file) => {
		file.extraUploadData = {
			test1: true,
		};
	});
},