Check file type and file size.