Maximum size for File Upload
Description
Environment
Activity
Heng Sin Low September 12, 2017 at 10:31 AM
Not going to implement no limit, not a safe option for web app.
Carlos Ruiz July 1, 2014 at 12:18 PM
http://www.globalqss.com/wiki/index.php/IDempiere/FullMeeting20140611
CarlosRuiz: ok, confirmed there is a hardcoded limit in zk
CarlosRuiz: 5120 - so, if sysconfig is set to zero that zk hardcoded limit applies
nmicoud: strange it has not been detected while implementing ticket #763
nmicoud: should i reopened it ?
CarlosRuiz: it works fine
CarlosRuiz: just that actually you cannot set -1 (unlimited)
CarlosRuiz: and zero means zk default
nmicoud: yes, unlimited cannot be set
nmicoud: but, i think that 999999 should be enough
CarlosRuiz: I would think is worthy to reopen if we want to implement unlimited
CarlosRuiz: otherwise is working fine
nmicoud: i agree
CarlosRuiz: ah - the comment is wrong
CarlosRuiz: "It specifies the maximum allowed size, in kilobytes, to upload a file from the client. A zero or negative value indicates that there is no limit."
nmicoud: yes, confusing
CarlosRuiz: yep- I think better to reopen it to clarify that and implement unlimited
Nicolas Micoud June 11, 2014 at 8:33 PM
Hi,
Just tested this functionnality.
The 'no limit' ability cannot be activated.
If the value is set to 0 or -1, then it is the hardcoded zk limit which apply.
Regards,
Nicolas
Heng Sin Low March 21, 2013 at 2:39 PM
Added ZK_MAX_UPLOAD_SIZE system configurator variable with default value of 5120 ( kb ).
Armen Rizal March 18, 2013 at 7:59 PM
1. Create new entries in System Configurator, i.e. MAX_IMAGE_FILEUPLOAD, MAX_ATTACHMENT_FILEUPLOAD, etc
2. Create new message "FileTooLarge"
Sample in WImageDialog.java
int MAX_KB = MSysConfig.getIntValue(MSysConfig.MAX_IMAGE_FILEUPLOAD, 250); // Max Upload Size in kB
int formDataLength = imageFile.getByteData().length;
int sizeKB = formDataLength/1024;
if (sizeKB > MAX_KB)
{
FDialog.error(0, this, "FileTooLarge", sizeKB
+ "kB > max " + MAX_KB + "kB");
return;
}
There is common requirement to configure maximum file size that user can upload.
Possible implementation:
Image field
Binary field
Attachment