Some file validation through javascript