HTML Form to see upload files and change them

I am using a HTML form for uploading a file using the code below.

In the next activity of my process I would like to have a form where I can see the file attached in the previous activity. I also need the option to change the file/upload a new file overriding the value of the cam-variable (or of cause the option to just leave it the same).

Is there a proper way to achieve that?


   <div class="form-group">
    <label class="control-label col-md-4"
           for="AntragUpload">Antrag</label>
    <div class="col-md-8">
      <input type="file"
             id="AntragUpload"
             cam-variable-name="AntragDocument"
             cam-variable-type="File"
             cam-max-filesize="10000000"
             class="form-control"/>
      <div class="help-block">This field is required</div>
    </div>
  </div>

  <script cam-script type="text/form-script">
    var fileUpload = $('#AntragUpload');
    var fileUploadHelpBlock = $('.help-block', fileUpload.parent());

    function flagFileUpload() {
      var hasFile = fileUpload.get(0).files.length > 0;
      fileUpload[hasFile ? 'removeClass' : 'addClass']('ng-invalid');
      fileUploadHelpBlock[hasFile ? 'removeClass' : 'addClass']('error');
      return hasFile;
    }

    fileUpload.on('change', function () {
      flagFileUpload();
    });

    camForm.on('submit', function(evt) {
      var hasFile = flagFileUpload();

      // prevent submit if user has not provided a file
      evt.submitPrevented = !hasFile;
    });
  </script>

Hope you can help me! :slight_smile: