Use hexdigest to ensure that tempfile names will be a reasonable length.  Remove illegal filename characters check since it is no longer relevant when doing a hexdigest on the filename