Hi everyone,
I follow the tutorial below and implement the code to my upload button and image.
https://support.wix.com/en/article/how-to-use-the-upload-button-with-code
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
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.
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?