check file size ahead of time