check for the existence of uploaded files before trying to read the file name