# Download File from user

**URL:** <https://community.jenkins.io/t/download-file-from-user/22175>\
**Category:** Ask a question\
**Created:** [October 21, 2024, 7:37am UTC](https://community.jenkins.io/t/download-file-from-user/22175 "2024-10-21T07:37:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ps1xReboot](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@ps1xReboot](https://community.jenkins.io/u/ps1xReboot)\
**Post date:** [October 21, 2024, 7:37am UTC](https://community.jenkins.io/t/download-file-from-user/22175/1 "2024-10-21T07:37:14Z")

</div>

Jenkins setup:

HI I need use user file from my pipeline. I wanted that user can choise file as parametr.

```auto
pipeline {
    agent any
    parameters {
        file(name: 'UPLOAD_FILE', description: 'Select a file to upload')
    }
    stages {
        stage('Copy File') {
            steps {
                
                script {
                    def uploadedFile = params.UPLOAD_FILE     
                    def destinationDir = "${env.WORKSPACE}"
                    
                    // Копируем файл в рабочую директорию
                    sh "cp ${uploadedFile} ${destinationDir}"
                    echo "File copied to workspace."
                }
            }
        }
    }
}

```

From this, the user can select a file as an option, but it seems Jenkins is not loading it into the workspace. I have an error that value of uploadedFile is null

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [October 21, 2024, 8:33am UTC](https://community.jenkins.io/t/download-file-from-user/22175/2 "2024-10-21T08:33:34Z")

</div>

The regular file parameter doesn’t work in pipeline scripts afaik.  
You should use the [File Parameter](https://plugins.jenkins.io/file-parameters/) plugin for this

---

<div class="post-metadata">

**Author:** ![ps1xReboot](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@ps1xReboot](https://community.jenkins.io/u/ps1xReboot)\
**Post date:** [October 21, 2024, 9:14am UTC](https://community.jenkins.io/t/download-file-from-user/22175/3 "2024-10-21T09:14:12Z")

</div>

Thank you very much.
