Front-end file size validation before upload

What is the way to check on file size before uploading it to the server?

Right click on the file and properties…

The Desktop client could probably check before upload, if you drag and drop in the browser, I am not sure if there is a way for all browser versions.