Hi,
I am having an error as: Failed setting items: TypeError: Cannot read property 'length' of undefined
when I apply the following code:
import wixData from 'wix-data';
export function uploadButton1_change(event) {
if($w("#uploadButton1").value.length > 0) {
$w("#uploadButton1").value[0].name};
$w("#uploadButton1").startUpload()
.then( (uploadedFile) => {
wixData.insert("User-GeneratedContent", uploadedFile).then(() => {
$w("#dataset1").refresh();
})
})
}
Please help me out to solve the issue!
Thank you
Thank you for the help! Ill check it out.
I will make sure to post with further details :)
Hello andrew choi,
Well first at all, why you do not explain and clarify your situation (issue) and give us some facts about your problem?
For example: (the facts are...)
1) I have a data-collection ....
2) which has a DATA-reference (column), named "upLoadFile"
3) I also have a dataset on stage, called "dataset1", which is connected to my data-collection.
4) And least but not last, i have an UPLOAD-BUTTON, called "uploadButton1".
5) Ohhh, i forgot to say that the name of my data-collection is "User-GeneratedContent" in which i want to save some upload-stuff.
Ok, now i can imagine what you want to do, perhaps now i can help you....
Take a look at this post i have found....
https://andreaskviby.wixsite.com/classifieds/new-ad