Multiple-image uploads with associated attributes

Hi!

I want my users to add a title and alt-tag when they upload an image. No problem if they are uploading one at a time, but it is a bit confusing with multiple uploads through the dashboard or other widgets. So I have a few questions/requests…

  • I know that with the dashboard widget I could use the metaFields to add fields that can be edited before form submission. When I do this, there is also a ‘name’ field that appears to be forced, which contains the filename. Is it possible to suppress this?

  • Is it possible to do any validation on the metaFields before submission? What I would really like is to be able to drag a bunch of images onto the dashboard, and have them show as invalid until these extra fields are filled in, at which point the upload button would be enabled.

  • Is there a better way to do this? Could I, for instance, use the Uppy.Form pattern and create form fields as images are dragged in?

  • Do I just need to accept that I should have some intermediate state after the images are uploaded, but before they are committed? I would rather keep things as streamlined as possible, but I would also like to avoid any unnecessary client-side shenanigans.

Hello! This is an older question, but I’ll try to answer it just in case anyone is in a similar position.

  1. As for suppressing an attribute, it might be easiest to just use the render option to make the input invisible. However, there is probably a better way of doing this that I am unaware of
  2. You could listen for the dashboard:file-edit-complete event and validate the metadata then. But I’m not fully sure what you’d need to do to stop the upload until it is valid
  3. I’m not familiar enough with the form pattern to say
  4. You might need to. It really depends…

Sorry for the somewhat vague answers. I’m not fully sure about some these questions

I hope this helps!
- Andrew