Fix checking the URL length when filename is specified