-
Bug
-
Resolution: Fixed
-
Critical
-
8.0.5
-
Security Level: Jean
-
None
Steps to Reproduce
configure a global max-upload-size in zk.xml
<system-config> <max-upload-size>1024</max-upload-size><!-- 1MB --> </system-config>
create a default upload button in a zul file
<button upload="true"/>
Upload a file > 1MB
Current Result
upload succeeds
Expected Result
upload should fail based on configured size limit
Root Cause
side effect of ZK-3276
A null value at component attribute level disables the default config.
(and obsolete catch of NumberFormatException)
Workaround
1. specify upload limit at component level
<button upload="true;maxsize=1024"/>
2. globally set the maxsize custom-attribute in a lang-addon.zul
<language-addon> <addon-name>patchFileUploadLimit</addon-name> <language-name>xul/html</language-name> <depends>zul</depends> <!-- patch ignored max size default config --> <component> <component-name>fileupload</component-name> <extends>fileupload</extends> <custom-attribute> <attribute-name>org.zkoss.zk.upload.maxsize</attribute-name> <attribute-value>${Integer.valueOf(1024)}</attribute-value> </custom-attribute> </component> </language-addon>
place the file into your classpath in package metainfo/zk/lang-addon.xml
see: https://www.zkoss.org/wiki/ZK_Client-side_Reference/Language_Definition
- relates to
-
ZK-3276 Fileupload size limit can be overridden from the client side
- Closed