Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.
In this lesson, learn how to validate a file upload’s size. By doing a little simple math we can convert megabytes to bytes and compare a MAX_FILE_SIZE with a File object’s size property and show a message to the user for files that fail the test.