Hi everyone,
I follow the tutorial below and implement the code to my upload button and image.
It was worked before but now it gives error “Error: -1 No File To Upload”
This is the code I used,
export function upBtn1_change(event, $w) {
//Add your code for this event here:
if ($w(“#upBtn1”).value.length > 0) {
$w(“#upBtn1”).startUpload()
.then((uploadedFile) => {
$w(“#upImg1”).src = uploadedFile.url;
})
.catch((uploadError) => {
console.log(Error: ${uploadError.errorCode}
);
console.log(uploadError.errorDescription);
});
} else {
$w(“#upImg1”).src = ‘wix:image://v1/a55dd7_59cce3571d3e44f2a1429277cc4c3d58~mv2.png/_.png#originWidth=400&originHeight=400’;
}
}
In other page the same code works fine so it should not be the network problem, please advise