Skip to main content
Nintex Community Menu Bar

File size for attached files in k2 form

  • Apr 22, 2021 6:25 AM UTC
  • 4 replies
  • 777 views
  • Translate All

I need to get file size of uploaded files in the form.and after adding all file sizes of uploaded files I have to show error that files uploaded are exceeding the max limit.so please let me know how to get the file sizes of the uploaded files in the form.

4 replies

  • Apr 22, 2021 6:34 AM UTC

Hi @namita02 ,

 

The file attachment control has a validation "tool" built in:

 

Simply type out the max amount of file size in the property console (on the right side of the screen), once a user puts a file arger than the specified limit, the file will not upload with an error like this:
"The file is larger than the maximum size (1 MB)."

Hope this helps 🙂

 

Kind Regards

Prineel

Translate

  • Author
  • Apr 22, 2021 11:44 AM UTC
Thanks Prineel for your suggestion.
But My form can attach 10 attachments. My requirement is total of those attachments should not exceed 30 MB. If I follow the suggestion provided by you above, it will restrict only for individual Attachment if it exceeds 30 MB. Can you please guide me.
Translate

  • Author
  • Apr 22, 2021 11:47 AM UTC
I am trying to do in List view as I have to attach multiple files.
Translate

  • Apr 22, 2021 1:43 PM UTC

Hi @namita02,

 

I dont think that it is possible to get the size of the attached control using K2 as there is nothing that gives you the size. You might be able to get it through javascript or some from of scripting since the file size does display in the control's elements on a browser's dev tools, but that may be difficult. The only alternative that I can think of, is to limit each attachment control, but that would mean you will only have a limited number of them.

 

Kind Regards

Prineel

Translate