Open fabmont opened 4 years ago
If I am not mistaken the ant design component directly initiates an upload to a server.
I imagine you would want to somehow "stage" some files, and then upload them when the user clicks a "form submit" button? I am not sure if this can be easily implemented.
Yeah, I'm talking about staging files. The user will select some files and when he hits the submit button, our app should send the binaries to our backend. I think it is possible to implement.
In the ant design docs https://ant.design/components/upload/ there is an Upload manually example, with which it should be rather straight forward to implement this functionality.
Im not sure if the file contents should be put into the formstate itself, or rather just into a component state.
It's a good point... I'll try this later and see how it works and I'll also try using Formik too to see the differences.
@fabmont were you able to get it working?
@Frank5000 I implemented an UploadFile component in my (undocumented, not yet releasable) glow library: https://github.com/jannikbuschke/glow/blob/master/core/web/src/files/upload-files.tsx#L31 There I use ant designs upload component to upload files to my backend. On successfull uploads I reference these already uploaded files in my local formik form. So when I send the form, I only reference already uploaded files, if this makes sense.
Hi, any news on that feature?
The upload component is quite important for some forms and maybe including this into the component list should be nice.