Then you can check this http://tracker.zkoss.org/browse/ZK-2215 look like its a bug not resolve yet by the way which zk version you are using?
sjoshi ( 2014-09-14 18:07:35 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I want to use the upload attribute to restrict the allowable files to upload by their extensions (.pdf and .docx only). The following does not work for me:
<button label="Browse" upload="true,maxsize=-1,accept=.png,.pdf" />
The accept attribute does not seem to work at all on Firefox 31.0
Using Chrome 37.0, it works if only one file extension is specified, but not for multiple extensions.
I am using zk 7.0.2
Can anyone help?
Try below code
<zk>
<button label="Upload Image" upload="true,maxsize=300">
<attribute name="onUpload">
<![CDATA[
org.zkoss.util.media.Media media = event.getMedia();
if (media instanceof org.zkoss.image.Image) {
org.zkoss.zul.Image image = new org.zkoss.zul.Image();
image.setContent(media);
image.setParent(pics);
} else {
Messagebox.show("Not an image: "+media, "Error", Messagebox.OK, Messagebox.ERROR);
break;
}
]]>
</attribute>
</button>
<separator />
<vlayout id="pics" height="360px" style="overflow:auto" />
</zk>
Then you can check this http://tracker.zkoss.org/browse/ZK-2215 look like its a bug not resolve yet by the way which zk version you are using?
sjoshi ( 2014-09-14 18:07:35 +0800 )editAsked: 2014-09-12 17:40:52 +0800
Seen: 77 times
Last updated: Dec 11 '19
Combobox performance issue [closed]
Detach gmarker on gmaps i get white screen in map, this a bug?
lostfocus of searchfield vs buttonclick in listbox
How to implement field validations and edit mask
Radio and checkbox focus styling
Autowire Spring bean in ZK controller