Before uploading files via a HTML-form, I want to do some client-side validating.
E.g. to check the filesize of the file selected by the user to upload.
Filesize should be, say, between 5MB and 50 MB. Javascript solution?!?

Nope, not really. By design, a person’s browser isn’t allowed to snoop around the file system.