I'm using a form to upload a file but want to limit the max size people upload and show an error message if it goes above a set limit!
I've researched and tried various methods but nothing seems to work.
This is what I have so far;
if (jQuery(".uploaded_file")[0].files[0].size / 1) {
error = true;
error_message.push('File is too big, please make smaller.');
this.value = "";
};
Not sure if I need to do something beforehand because I keep getting Cannot read property 'size' of undefined