Check if the fjr has input files before the upload
Use re.sub instead of lstrip. Fix #4566