8 Replies Latest reply on Jul 24, 2014 5:26 AM by Scott Carpenter

    Chrome update breaks <rich:fileUpload> 3.3.3.Final

    John Peters Newbie



      The latest Chrome update is breaking the rich file uploader. Here's the component on the showcase:




      How do I submit a bug report?



        • 1. Re: Chrome update breaks <rich:fileUpload> 3.3.3.Final
          Brian Leathem Master

          RichFaces 3 is no longer supported.  Migrate your application to RichFaces 4 for support with modern browsers.

          • 2. Re: Chrome update breaks <rich:fileUpload> 3.3.3.Final
            Mark Donovan Newbie



            Object.extend(FileUpload.prototype, {

                        add: function (A) {

                            if (this.disabled) {



                            if (!A.value) {



                            if (!this.checkFileType(A.value) || !this.checkDuplicated(A)) {

                                var F = A.value;

                                var B = A.cloneNode(true);

                                B.value = "";

                                A.parentNode.replaceChild(B, A);

                                this.currentInput = B;

                                if (this.events.ontyperejected) {

                                    this.element.fire("rich:ontyperejected", {

                                        fileName: F





                            var D = new FileUploadEntry(A, this);


                            if (this.runUpload) {


                            } else {





                            // When the object was being cloned, it's onchange value was being fired as well.

                            // was

                            // var B = A.cloneNode(true);

                            // A.onchange = null;



                            // begin



                            var onchangeAttribute = $j(A).attr('onchange');

                            $j(A).attr('onchange', '');

                            var B = A.cloneNode(false);

                            $j(B).attr(onchange, onchangeAttribute);



                            // done



                            A.style.cssText = "position: absolute; right: 0px; top: 0px; display: none; visibility: hidden;";

                            B.id = this.id + ":file" + (this.idCounter++);

                            B.value = "";

                            this.currentInput = B;


                            if (this.events.onadd) {

                                var C = [];


                                this.element.fire("rich:onadd", {

                                    entries: C



                            if (this.runUpload) {





            • 3. Re: Chrome update breaks <rich:fileUpload> 3.3.3.Final
              andrey panasenko Newbie

              Try to add attribute noDuplicate="true". It works for me.

              • 4. Re: Chrome update breaks <rich:fileUpload> 3.3.3.Final
                Scott Carpenter Newbie

                This worked great for me. Thanks!


                Code as used in 3.3.4:


                var onchangeAttribute = $(elt).attr('onchange');

                $(elt).attr('onchange', '');

                var newUpload = elt.cloneNode(false);

                $(newUpload).attr('onchange', onchangeAttribute);

                • 5. Re: Chrome update breaks <rich:fileUpload> 3.3.3.Final
                  Mark Donovan Newbie

                  I just tried noDuplicate="true". Works just as well.

                  I'll probably go with this route as it's less invasive.


                  Thanks Andrey

                  • 8. Re: Chrome update breaks <rich:fileUpload> 3.3.3.Final
                    Scott Carpenter Newbie

                    Ha! I saw your comment about noDuplicate after I had already gotten a new UI jar compiled with the JS fix, and my first thought was that it was only a variation on the JS change (and I don't think I've really found noDuplicate documented, still), so I just stuck with that until I ran into another problem related to this. But ultimately it is noDuplicate that fixes (or at least works around) this for me, and yes, it is a much better path than mucking about with local changes to richfaces-ui jar!


                    I just wanted to say thank you, Andrey, and others in this thread -- this is very helpful for bridging the time to a Chrome fix.


                    Now, back to that 3.x to 4.x migration I happened to be working on already. :-)