Closed indefinitelee closed 6 years ago
You can add metadata to files using the setMetadata
method or you can add the metadata to the request right before upload in a custom processing method.
so using the metadata plugin i'd do something like:
FilePond.setOptions({
fileMetadataObject: {
userId: this.state.userId,
customName: this.state.customName
}
})
and these will be included on the file data sent to my server?
I think that will take the initial state value and copy it to files, if the state updates the metadata will not.
I think calling setMetadata on each file after the state updates would be better if you want the latest value.
Hi, I am struggling to add user form data to a file upload. How can I do this?
@LeviStrange please don't double post. https://github.com/pqina/react-filepond/issues/36
How can I add some user supplied values along with the file payload sent to my server? for example, my users will need to add a file and then input some values such as
i can easily add some input fields and clickHandlers to get those values into state, but not sure how to get FilePond to access them and send to backend.
thanks