fileUploadField - remove added files

Came across an issue with fileUploadField and empty files. When a new file is added to the control and saved into say rii!files, and then removed, seems that it will be uploaded anyway once the form is submitted. Setting ri!files to null doesn't help either.  I do see a note in Appian docs on the file upload control that files will need to be deleted or reverted in the target in a cancellation scenario. However, our issue is that if an empty file is added, even if it is removed from the control, upon submission we get " Could not upload “file name”. Reason: This file is empty." error, and there is no way to get out of it. The fact that non-empty files are being uploaded even if they are removed before submitting is still an issue, but we can handle that.

I tried adding validation to the upload to stop users from uploading empty files, without luck.

    a!fileUploadField(
      label: "File Upload",
      labelPosition: "ABOVE",
      target: cons!TEST_FOLDER,
      saveInto: ri!files,       
      validations: if(or(fv!files.size =0),"Attachments cannot be empty", "")
    ),

Any ideas how to handle the empty files? We're using 19.1 for a few more days, going to 19.3 this weekend, in case it makes a difference.

Thanks.

 Discussion posts and replies are publicly visible