title: Fetching uploaded files in Jenkins
body: <p>Upload (per progress bottom bar status) goes through in Jenkins. But don't see option to locate or fetch uploaded file from Jenkins.</p>
  
  <p>Here is simple script with File parameters, </p>
  
  <pre><code>properties(
      [
          parameters(
              [ file(name: "file1.zip", description: 'Choose path to upload file1.zip from local system.'),
                file(name: "file2.zip", description: 'Choose path to upload file2.zip from local system.') ]
              )
      ]
  )
  
  node {
      stage("Fetch Uploaded File") {
          sh '''
          ls -l file1.zip file2.zip
          ls -l ${WORKSPACE}/file1.zip ${WORKSPACE}/file2.zip
          '''
       }
  
  
  }
  </code></pre>
  
  <p>Tried with def input file option per other post, but no luck of reaching uploaded file. Any inputs?</p>
  
  <pre><code>    def inputFile = input message: 'Upload file', parameters: [file(name: 'data.ear')]
      new hudson.FilePath(new File("$workspace/data.ear")).copyFrom(inputFile)
      inputFile.delete()
  </code></pre>
  
  <p>With scripted full pipeline pasted above, getting below error..</p>
  
  <pre><code>[Pipeline] {
  [Pipeline] stage
  [Pipeline] { (Fetch Uploaded File)
  [Pipeline] sh
  [testSh] Running shell script
  + ls -l file1.zip file2.zip
  ls: cannot access file1.zip: No such file or directory
  ls: cannot access file2.zip: No such file or directory
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] }
  [Pipeline] // node
  [Pipeline] End of Pipeline
  ERROR: script returned exit code 2
  Finished: FAILURE
  </code></pre>