check file type and length