Error on Upload Button

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

I have the same issue as it only work for upload button which is “NOT” required.
making it required somehow giving us the error “NO FILE TO UPLOAD”.

Anyone can help us?

Hi,
Make sure that your dataset’s settings and the database’s permissions allows the upload, if it does, please send your editor’s URL so we can inspect.

have you found a solution for your problem, I’m facing the same issue

Do I have to create a Database in order to hold the files?

I’m facing the same issue, and when I try to upload a second image (it has to be a different image), the upload succeeds, how can I fix this issue?