# Camunda form File Submition cannot be found in variable scope

**URL:** <https://forum.camunda.io/t/camunda-form-file-submition-cannot-be-found-in-variable-scope/54241>\
**Category:** Discussion & Questions\
**Created:** [August 14, 2024, 12:58pm UTC](https://forum.camunda.io/t/camunda-form-file-submition-cannot-be-found-in-variable-scope/54241 "2024-08-14T12:58:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![karim](https://forum.camunda.io/letter_avatar_proxy/v4/letter/k/46a35a/32.png) [@karim](https://forum.camunda.io/u/karim)\
**Post date:** [August 14, 2024, 12:58pm UTC](https://forum.camunda.io/t/camunda-form-file-submition-cannot-be-found-in-variable-scope/54241/1 "2024-08-14T12:58:07Z")

</div>

I’ve been trying to upload a file to my process and then use it in the tasks that follow. However, I keep getting the value null as if the upload never happened.  
This is weird because i followed the camunda doc that specifies how a file should be uploaded and allocated to a variable.  
this is the HTLM code used in the form

```html
<input 
    type="file"
    id="1"
    cam-variable-name="INVOICE_DOCUMENT"
    cam-variable-type="File"
    cam-max-filesize="10000000" />
<script>
camForm.on('submit', function () { 
    var fileInput = document.getElementById("1");
    var file = fileInput.files[0]; // Get the first file

    camForm.variableManager.createVariable({
        name: 'INVOICE_DOCUMENT',
        type: 'File',
        value: {
            file: file,
            filename: file.name,
            mimeType: file.type
        }
    });
});
</script>

```

Even adding the camForm script in the end it didn’t work. Still getting value null.
