I am creating a Jenkins pipeline job that asks for a file from user to upload. Here is the snippet:
stage('Upload a file') {
def inFile = input id: 'file1', message: 'Upload a file', parameters: [file(name: 'data.tmp', description: 'Choose a file')]
sh "echo \\\"Uploaded ${inFile}\\\""
}
When I uploaded a zip file "data123.zip", this original filename is lost and is renamed to "data.tmp", which is what I obtain from the variable inFile
.
Other things that I tried that didn't work (I know some of them are silly):
${inFile.remote}
file(name: '')
file(description: '')
${file1}
Do you know if it's possible to get the original filename when uploading a file using Jenkins pipeline input step?