Increase Manageable File Attachment Size to >300 kb

Post your ideas & suggestions for new nuBuilder features or other improvements

Increase Manageable File Attachment Size to >300 kb

Unread postby pmjd » Wed Oct 13, 2021 10:01 am

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?
pmjd
 
Posts: 100
Joined: Fri Mar 12, 2021 7:08 pm
nuBuilder Version: 4.5

Re: Increase Manageable File Attachment Size to >300 kb

Unread postby kev1n » Wed Oct 13, 2021 4:29 pm

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;
}
kev1n
nuBuilder Team
 
Posts: 2062
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Increase Manageable File Attachment Size to >300 kb

Unread postby pmjd » Wed Oct 13, 2021 7:17 pm

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?
pmjd
 
Posts: 100
Joined: Fri Mar 12, 2021 7:08 pm
nuBuilder Version: 4.5

Re: Increase Manageable File Attachment Size to >300 kb

Unread postby kev1n » Thu Oct 14, 2021 3:51 pm

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.
kev1n
nuBuilder Team
 
Posts: 2062
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5


Return to Ideas & Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests