Calculate the total size in Kb of all uploaded files

From SMTX Wiki
Jump to navigation Jump to search

Field 1 : multi upload file (internal label: 'file')
Field 2 : Hidden field (internal label: 'roSize')
Field 3: Read only display field (internal label: 'roTotalSize')
Field 2 holds this NCALC:

     "replace(ForEachString('#REPLACE-FORMFIELD-attachmentsizecheck||file||#', '(BR)' , 'FileSize(GetXmlProperty(\'{0}\', \'/A/@HREF\'), \'MB\')', '+', 0),',','.')"

Note: where it says (BR) it shoud be in HTML '<>', but the WIKI interprets this :)



Field 3 shows the total size in MB:
Default value: #REPLACE-FORMFIELD-attachmentsizecheck||roSize||#

Sample form: https://dev.ssp7.smt-x.com/Forms/Admin/fieldDetail.aspx?id=14658