sanity-plugin-media icon indicating copy to clipboard operation
sanity-plugin-media copied to clipboard

Feature Request: Upload multiple images in an array

Open mikepziegler opened this issue 2 years ago • 5 comments

Hi, I have a feature request about uploading multiple images in an array. This can happen which a drag and drop or selecting the images with either mouse or clicking a tag. It would be a nice addition that can contribute a much faster workflow on sanity.

Thank you so much for your work!

mikepziegler avatar Sep 04 '22 22:09 mikepziegler

Hey @mikepziegler – if I understand you correctly, I believe this is already possible in Sanity when working with arrays of images. e.g.

// Your document schema
// You can drag and drop multiple images into this array input, and they'll upload as you expect!
...
{
  name: "images",
  title: "An array of images",
  type: "array",
  of: [
    {
      type: "image",
    },
  ],
},
...

However, I don't believe it's possible when dealing with arrays of objects (that contain their own nested fields), and that is more of a studio concern.

Does this issue sound like what you're looking for? If not, would appreciate further clarity here – thanks!

robinpyon avatar Sep 12 '22 16:09 robinpyon

Hi, I have the same question about array of images: I saw that I can upload multiple images dragging them to my array field directly but if I had previously uploaded my images how can I select all of them from the selection screen?

If I click "add an item" and then I choose to select my image through the media plugin, I can select one image only.

Thanks 🙏🏻

valse avatar Sep 13 '22 09:09 valse

Ok, I didnt know about drag and dropping into the Add Items button. I've tested it and it seems that you can only upload maximum 5 pictures simultaniously.

What I want to add (I forgot to put it in the description) is to select multiple pictures in the media library and add it to the post.

mikepziegler avatar Sep 27 '22 06:09 mikepziegler

Did @valse or @mikepziegler find a way to do this (select multiple images from the media library to add to the array)?

ptimson avatar May 10 '23 16:05 ptimson

I also wonder why this is not possible since it is shown in the README right at the top. When opening the media plugin I can only click one image and it selects that image and closes the media plugin right after...

Image right form the README

My field definition is simple...

defineField({
   name: 'images',
   type: 'array',
   of: [{ type: 'image' }]
})

felixmpaulus avatar Feb 13 '24 13:02 felixmpaulus