How can I store the exact size of the file being uploaded in a variable?

I am facing a problem where I want to store the exact size of an uploading file in a variable so that I can access it later to validate even if the section containing the file upload field is hidden. I am on v19.1. PS. By size, I mean the exact size in bytes and not "<1KB" which is retrieved by using fv!files.size. I cannot use a!save() function in validation attribute and fv!files.size is not accessible outside validation.

  Discussion posts and replies are publicly visible

Parents Reply
  • If I understand correctly, you should still be able to apply the document function in this scenario.  Once a document reference is stored in a variable (even if it's not a document type - use todocument()), you can use document(<documentvariable>,"size") to return a numerical representation of the size of  the file and compare that to 0.

    If you save the the result of that operation, you can use it in the evaluation of a showWhen, or in a validation.

Children