check file exists in getTempFilename()