Hi i am trying to save my user uploaded image to the dataset but how i try also cant, is there any way to solve this problem?
"attachment" : $w('#attachmentUpload').value ,
"attachment is the field i want to insert , $w(‘#attachmentUpload’).value is the upload button
import wixLocation from 'wix-location';
import wixData from 'wix-data';
export function deposit_click(event) {
$w("#errorMessage").collapse();
$w("#doneGif").collapse();
$w("#wait").expand();
$w("#waitGif").expand();
let toInsert = {
"types" : "DEPOSIT" ,
"setScore" : " + " ,
"amounts" : Number($w('#amounts').value) ,
"channel" : $w('#channel').value ,
"attachment" : $w('#attachmentUpload').value ,
"tips": Number("0") ,
"reference" : $w('#reference').value ,
"status" : "NEW REQUEST" ,
"remark" : " " ,
"bonus" : $w('#bonus').value ,
"companyAccount" : $w('#companyAccount').value ,
"casino" : $w('#casino').value ,
"userAccount" : " " ,
};
wixData.insert("Cashier", toInsert)
.then( (results) => {
let item = results;
$w("#errorMessage").collapse();
$w("#wait").collapse();
$w("#waitGif").collapse();
$w("#doneGif").expand();
wixLocation.to('/account/history') ;
})
.catch( (err) => {
console.log(err);
$w("#errorMessage").expand();
$w("#wait").collapse();
$w("#waitGif").collapse();
$w("#doneGif").collapse();
})
}
/**
* Adds an event handler that runs when an input element's value
is changed.
* @param {$w.Event} event
*/
export function attachmentUpload_change(event) {
// This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4
// Add your code for this event here:
}