Binds an (alternative) file parameter to a local file near the workspace for convenience. Parameters can be retrieved in other ways, depending on the specific parameter type.

How to use it in a declarative pipeline:

pipeline {
  agent any
  parameters {
    base64File 'THEFILE'
  }
  stages {
    stage('Example') {
      steps {
        withFileParameter('THEFILE') {
          sh 'cat $THEFILE'
        }
      }
    }
  }
}
  
By default, there will be an error if there is no parameter for the build but you can ignore this error using the parameter attribute allowNoFile. In this case your Pipeline must take into account the possibility that the file does not exist:
pipeline {
  agent any
  parameters {
    base64File 'THEFILE'
  }
  stages {
    stage('Example') {
      steps {
        withFileParameter(name:'THEFILE', allowNoFile: true) {
          sh 'if [ -f "$THEFILE" ]; then cat $THEFILE; fi'
        }
      }
    }
  }
}