'Jenkins pipline upload file

I'm trying to create a jenkins pipeline with file upload parameter. unlike regular job that uploads the file to the workspace, pipeline job seem to do nothing with the file I pick.

Do you know how I can use uploaded files?

from the UI - pipeline configurations: enter image description here

from the UI when running the pipeline: enter image description here

my pipeline script for example run 'ls' just to check if the file was uploaded:

pipeline {
    agent any
        
    stages {
        stage('test') {
            steps {
                sh 'ls'
            }
        }
    }
}

Thanks, Avi



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source