check if the file exists before the upload