Check document size after selecting document from uploader in a form sail

I have a form sail with a fileUploadField. When I select a file, I need to check the size and disable a button if is greather than 1MB.
The check is the following:
or(rule!APN_isBlank(save!value),document(save!value,"size")>1024000)

When a perform this check an error appear:

Interface Definition: Expression evaluation error: An error occurred while executing a save: Expression evaluation error at function 'document' [line 886]: Error evaluating function 'document' : Document Does Not Exist or has been Deleted

How can I resolve this problem?
Tanks

OriginalPostID-272088

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    I recommend you consider using the utility rule I posted a few weeks ago near the end of the comments section in the link @chandrasekharg posted above. But keep in mind that the filesize returned is very approximate - like "2.1 MB", etc.

    @jaisym: the rule I posted in the above thread handles both the old and new functionalities. The file upload size is still in the returned properties in the new version, it's just been moved around a bit in the data structure.
Reply
  • 0
    Certified Lead Developer
    I recommend you consider using the utility rule I posted a few weeks ago near the end of the comments section in the link @chandrasekharg posted above. But keep in mind that the filesize returned is very approximate - like "2.1 MB", etc.

    @jaisym: the rule I posted in the above thread handles both the old and new functionalities. The file upload size is still in the returned properties in the new version, it's just been moved around a bit in the data structure.
Children
No Data