Upload multiple image items to data collection?

I have a data collection with images and booleans (i want to create a filterable gallery eventually).
Right now if i want to add items, i need to add each image individualy and sparately - to click to add a new item, choose the image from my uploads, add it, move to the next item and so on.

I need to upload many images. Is there a way to upload many items (that’s many images) to this database? I want to upload many images at once and have them as separate items in this database.

Help would be greatly appreciated.
Thanks.

4 Likes

Hi,

This forum is specifically for questions about using Corvid by Wix.

If you have questions about uploading data to your database collections please contact Wix Support .

Dara | Corvid Team

Hello danielzard,

there are so many posts about this problem…

https://www.wix.com/corvid/forum/community-discussion/multiple-file-image-upload

https://www.wix.com/corvid/forum/community-discussion/user-upload-images-to-media-gallery-field-in-database

https://www.wix.com/corvid/forum/community-discussion/upload-multiple-images-to-database

https://www.wix.com/corvid/forum/community-discussion/upload-more-files-eg-images-with-a-single-upload-button

and so on.

I am sure, if you read all that stuff, you will be able to solve your problem by yourself.

Hey Dima, thanks for your reply.
I’ve been looking for a while, and didn’t find any solution.
In the links you provided there are 2 cases of user (site visitor) upload (not what i want), and one case that seems to be similar to mine, with no answer.

This seems like a basic functionality to me, i was guessing there’s a simple solution, but i didn’t find anything to solve this at all yet.

Thanks.

That wasn’t very helpful at all;
The first link provided was even closed without answer. The others are not relevant.

I’m afraid the correct answer to the question is:
You can not.

I have migrated a large set of images from another server by attaching a beforeInsert hook on my collection where I wanted the records with images , by using a piece of code like this:
(Unfortunately rp is a deprecated npm package, so you’ll need to find an alternative to make the request)

export async function myCollectionWithImages_beforeInsert(item, context) {
 var url = item.fieldWithImageURL; //image URL
 var filename = item.Title; // name of image
 var response = await rp.get({ url, encoding: null }); //GET image from URL
 var mediaOptions = {
 "mediaOptions": {
 	"mimeType": "image/png",
 	"mediaType": "image"
 	}
 };
 var fileInfo = await mediaManager.upload("/MyUploadedImages", response, filename, mediaOptions); //upload to wix media
 item.image= fileInfo.fileUrl; //set internal wix-media-URL in image field
return item;
}

@ronald28659