Page 1 of 1

Increase Manageable File Attachment Size to >300 kb [done]

Posted: Wed Oct 13, 2021 2:31 am
by pmjd
Reading the docs it warns to keep attached files to below 300 kb due to nuBuilder converting them to JSON format.

Would it be possible to change this so the max file size could be bigger?

Re: Increase Manageable File Attachment Size to >300 kb

Posted: Wed Oct 13, 2021 8:59 am
by kev1n
Good idea! Using the latest version from Github (just nuform.js has changed), you can declare a nuOnFileLoad() function e.g. in the header and/or any form to override the maximum length check

Code: Select all

function nuOnFileLoad(id, file) {
  if (file.length > 12000000) {
    // 600KB
    nuMessage([
      nuTranslate("File is too large, cannot be saved. Must be under 600Kb"),
    ]);
    return false;
  }

  return true;
}

Re: Increase Manageable File Attachment Size to >300 kb

Posted: Wed Oct 13, 2021 11:47 am
by pmjd
Great, thank you.

I'm looking at maybe using nuBuilder for a record system that would hold scanned PDF records of a a few MBs in size, do you know what the upper limit would be for uploaded file sizes in nuBuilder?

Re: Increase Manageable File Attachment Size to >300 kb

Posted: Thu Oct 14, 2021 8:21 am
by kev1n
AFAIK there is no limit but it simply doesn't make sense after a certain size, because it becomes too slow. It's best to try out different sizes and measure the times.