client and server side validation for file upload