Hi guys so i’m trying to display an image that has been saved to a collection using write only and then display that image from a second collection using read only. (to begin with)
I have used the following tutorial to assist
https://www.youtube.com/watch?v=FVARVy3YS74
I have the following on my page. a normal file upload button and an image of the upload button that i’m hoping will display the recently uploaded image to the write only file collection
I’m trying to achieve exactly the same functionality as the file upload within this forum i.e. the image displays straight away select (as below)
The code i have used so far is as follows. Dataset1 is write only, Dataset2 is read only.
I know this tutorial was for text based uploads so help is very much appreciated, which is probably why there are errors in my code.
also this tutorial video, doesn’t show the submit button being connected to the database within the editor.
import wixData from ‘wix-data’;
function getdata(){
letquery = wixdata.query(‘#dataset1’);
return query.limit(1000).find().then(results => {
console.log(‘getdata’),results);
return results.items;
}];
}
$w.onReady( () => {
$w(‘#dataset2’).onAfterSave( () => {
getdata().((items) => {
$w(‘#image22’).data = items;
}];
}];
}];
Thanks
Adam