File Input Validation

Can someone share an example how to validate file input (client, ajax, server side)?

I tried different ways but the only thing i could validate is “required”. Size and extension validation doesn’t work.