I've seen a few similar questions asked, but couldn't get them to work with my code so just wanted to see if I could get some additional help - my code below:
const upload(input, file){
var fileUploadedCorrectly = true
file.onload = (e) =>{
if(code checking if extension is .csv){
fileUploadedCorrectly = true;
} else {
fileUploadedCorrectly = false;
}
}
}
function retrieve(in){
const file = in.files[0];
if (fileUploadedCorrectly){
code to continue upload
} else {
code to display error message
}
}
I'm having trouble with accessing the value of fileUploadedCorrectly in the retrieve() function. Any help would be much appreciated - thank you very much.