added check for max allowable filesize