0

FileUpload issue.

asked 2012-05-07 11:56:34 +0800

dcpatadia gravatar image dcpatadia
12

Hi All,

I have used below code to fileupload demo.
<zk>
<window title="upload" border="normal">
<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 ></separator>
<vlayout id="pics" height="360px" style="overflow:auto" ></vlayout>
</window>
</zk>


With this simple demo fileupload code, I am still getting "The server is temporarily out of service." error when I select file from popup window.
Kindly help me to resolve this issue as it is very much urgent for me to resolve this issue.

Thank you in advance.

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2012-05-07 11:57:17 +0800

dcpatadia gravatar image dcpatadia
12

I used ZK 6.0.1 latest version.

link publish delete flag offensive edit

answered 2012-05-14 01:11:29 +0800

samchuang gravatar image samchuang
4084 4

hi, I tested your code using tomcat, it works fine

link publish delete flag offensive edit

answered 2012-05-15 03:02:19 +0800

zelda gravatar image zelda
21

when you build your java .war file of your zk app, try adding the <zk path>/dist/lib/ext/commons-fileupload.jar and <zk path>/dist/lib/ext/commons-io.jar to your .war file... i don't know why, but i got exactly the same problem as you and now the problem is no more.

link publish delete flag offensive edit

answered 2012-05-29 00:36:19 +0800

javadude gravatar image javadude
63
http://javadude.wordpress...

updated 2012-05-29 00:37:09 +0800

It is not a ZK problem, but a Glassfish 3.1.2 problem ! We searched the web and there are related problems.
There is workaround/fix until the next service release of Glassfish. Replace the web-core.jar file. It worked for us.

See: http://java.net/jira/browse/GLASSFISH-18444

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-05-07 11:56:34 +0800

Seen: 284 times

Last updated: May 29 '12

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