Hi,
You can use the upload button as explained here . Afterwards, in order to save the data to your collection, you should create an onClick event for the submitting button, get the image src attribute and use the insert function to insert it to the collection. Lets say that you wish to insert an image and a description to the collection:
export function submitBtn_onClick(event){
//each attribute is the name of the columns
let toInsert = {
image: $w('#imageUploadedId').src,
description: $w('#description').value
};
wixData.insert('collectionName', toInsert)
.then(() => {
console.log('insert successfuly');
})
.catch((err) => {
console.log('insert error');
});
}
Click here to learn more about the insert function.
I hope it’s clear.
Best,
Tal.