Append uppy Dashboard files on existing form data
See original GitHub issueThis may be the silliest question ever but I’m struggling for hours now and thought to give it a shot:
I’m using Rails and have a simple form with the following input fields:
- Name
- Attachments
My question is this: Is it possible to attach uppy
(with its cool-looking Dashboard
) in my existing form and submit all data at once using the parent form’s submit button?
I think I currently can’t do this; If I use XHRUpload
and let a user submit attachments asynchronously I’d have to do lots of “housekeeping” since I won’t have a user model id on the server to attach the files to.
Using a regular form field instead, I do get all the files on form submission but I don’t get to use the awesome Dashboard
. Is there a middle ground?
Is there a way to use uppy
and let users select and remove files through its Dashboard
but only upload on my form’s submit?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:7
Hi! What you can do:
Dashboard
optionally setinline: true
to show Dashboard inline with your form, and thenhideUploadButton: true
to hide the upload button, so you can use your own from the form. See https://uppy.io/docs/dashboard/ for details.Form
plugin https://uppy.io/docs/form/ to attach <form> input key/values to file uploads. Use Uppy’s upload button oruppy.upload()
to trigger the upload.Or intercept your form’s submit event and call
uppy.upload()
so that Uppy will send the files along with metadata to your server. You could also get files that user selected from Uppy by iterating overuppy.state.files
object. There’s currently no way to just use the Dashboard as file picker that will add actual files to your form’s input, but there is a way to upload those files first, and then append results (urls) to your form.I am not sure which of those would help the most, but I think this is a valid use case which we were hoping to cover with
Form
plugin, and I’d be happy to add more options to it.please how did you resolve this issue, I am challenged with the same problem