0

Upload button not working on ie9

asked 2015-08-12 10:58:22 +0800

a1t0r gravatar image a1t0r
1 2

updated 2015-08-12 11:30:17 +0800

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!

delete flag offensive retag edit

5 Answers

Sort by » oldest newest most voted
0

answered 2015-08-30 11:26:01 +0800

Darksu gravatar image Darksu
1991 1 4

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

link publish delete flag offensive edit
0

answered 2015-08-31 07:34:04 +0800

a1t0r gravatar image a1t0r
1 2

Hi Darksu,

This code does not work either. Have you tested on IE9? Because I have tested it and it doesn´t. If you answer a question be sure that your code works!

link publish delete flag offensive edit
0

answered 2015-08-31 07:53:25 +0800

Darksu gravatar image Darksu
1991 1 4

Hello a1t0r,

This code has been tested multiple times!!!

If it does not work for your environment then something else is going wrong!!!

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2015-08-31 08:25:36 +0800

a1t0r gravatar image a1t0r
1 2

Hi Darksu,

Your code does not work i tested in IE9 and zkfiddle.org so my environment is not the only one where your code does not work.

link publish delete flag offensive edit
0

answered 2015-08-31 09:28:34 +0800

Darksu gravatar image Darksu
1991 1 4

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

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2015-08-12 10:58:22 +0800

Seen: 54 times

Last updated: Aug 31 '15

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