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 Children
  • That's correct. When do you need the size? Just after uploading the file or after submitting the form? In case you need after the uploading the file, you can do a work around on this. After uploading the file, provide a soft submit button which will submit the form and revert back to the same form, make use of chaining so the form will get submitted and reopen the form, by doing this your document will get uploaded to the KC folder and you will be able to get the size.

    The things that you need to make sure is the values that the user have entered already, that should retain after clicking the soft submit button.