How to get a file using base64 file input parameter

I tried below code base to read a file through input parameter. But i am getting No such DSL method ‘base64File’ found among steps error. Do i need to import any classes or install any plugins

def inputFile = input message: ‘Upload file’, parameters: [base64File(‘file’)]
withEnv([“inputFile=$inputFile”]){
sh ‘echo $inputFile |base64 -d > File.csv’
}

You need the File Parameter plugin. There it is also documented how to use it.

1 Like