files-ui-react icon indicating copy to clipboard operation
files-ui-react copied to clipboard

addExtraData

Open memcaliber opened this issue 2 years ago • 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.

memcaliber avatar Aug 11 '23 13:08 memcaliber

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,
		};
	});
},

OneHatRepo avatar Sep 06 '23 21:09 OneHatRepo