0

file upload gives always null..

asked 2012-07-02 13:35:37 +0800

nitesh gravatar image nitesh
3

hi
when i run the api demo on the zk site itself it works.
but when i copy the same code it gives null always.
i have tried disabling/enabling the event thread.but result is same.
plz help

<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>

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-09-11 04:17:35 +0800

paowang gravatar image paowang
140 6

Do you put commons-io and commons-fileupload in your classpath ?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-07-02 13:35:37 +0800

Seen: 127 times

Last updated: Sep 11 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More