-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I have to develop a upload button in IE9. I have done the following:
ZUL FILE:
<button id="btnIcono" class="iconoCuadro" upload="true,maxsize=-1"yle="padding:0px 6px !important;"/>
JAVA FILE:
@Listen("onCreate=#win")
final int limitBytes = constantesAplicacionBean.getMaxUploadSize() * 1024 * 1024;
final org.zkoss.util.media.Media media = event.getMedia();
if (media instanceof org.zkoss.image.Image) {
try {
if (media.getStreamData().available() > limitBytes) {
final String msj = msgs.getString(Etiquetas.TAMAÑO_SUBIDA_SUPERADO).replace("{0}", media.getName())
.replace("{1}", constantesAplicacionBean.getMaxUploadSize().toString());
Messagebox.show(msj, msgs.getString(Etiquetas.WINDOW_TITLE_ERROR), Messagebox.OK, Messagebox.ERROR);
} else {
btnIcono.setImageContent((Image) media);
}
} catch (final IOException e) {
final String msj = msgs.getString(Etiquetas.TAMAÑO_SUBIDA_SUPERADO).replace("{0}", media.getName())
.replace("{1}", constantesAplicacionBean.getMaxUploadSize().toString());
Messagebox.show(msj, msgs.getString(Etiquetas.WINDOW_TITLE_ERROR), Messagebox.OK, Messagebox.ERROR);
}
} else {
final String msj = msgs.getString(Etiquetas.TIPO_ARCHIVO_SUBIDA_INCORRECTO).replace("{0}", media.getName());
Messagebox.show(msj, msgs.getString(Etiquetas.WINDOW_TITLE_ERROR), Messagebox.OK, Messagebox.ERROR);
}
}
This works on firefox and chrome but not on ie9. I have tried the following solution that i have found in the web:
Solution -> zkfiddle.org/sample/3djbtd1/3-upload-problem-ie10#source-1 (i cant post links)
I am using zk 7.0.3. Somebody have solved this issue? Thank for helping!
Hello a1t0r,
A similar question has been answered at the following url:
http://forum.zkoss.org/question/95301/cannot-upload-file-on-ie9/
Could you please check it out?
Best Regards,
Darksu
Hello a1t0r,
Please update the zul file with the following css (for some reason the css was not shown):
<zk>
<style>
.ie8 span.z-upload, .ie9 span.z-upload, .ie10 span.z-upload { display:inline-block; }
.ie8 span.z-upload input, .ie9 span.z-upload input, .ie10 span.z-upload input { z-index: 1; }
</style>
<window border="normal" title="hello" apply="demo.getting_started.TestComposer">
<div>Multifile upload demo!</div>
<button id="btn" label="Upload some files!" upload="true,maxsize=6000,multiple=true"/>
</window>
</zk>
Tested using browserstack.
Best Regards,
Darksu
Asked: 2015-08-12 10:58:22 +0800
Seen: 54 times
Last updated: Aug 31 '15