Flash uptime does not work in IE8 using PLupload

I have a simple javascript function inside $(function() { ... });body

var uploader = new plupload.Uploader({
         runtimes: 'html5,flash,silverlight',
         browse_button: 'pickfiles',
         container: 'uploader',
         max_file_size: '20mb',
         unique_names: true,
         multiple_queues: false,
         //drop_element: 'dropzone',
         url: '/Home/Upload',
         flash_swf_url: '../../../Scripts/upload/plupload.flash.swf',
         silverlight_xap_url: '../../../Scripts/upload/plupload.silverlight.xap',
         filters: [
               { title: "Image files", extensions: "jpg,gif,png" },
               { title: "Zip files", extensions: "zip" }
           ],
         chunk_size: '2mb',
         resize: { width: 320, height: 240, quality: 90 }
      });

      uploader.bind("Init", function (up, params) {
         $("#runtime").html("<div>Current runtime: " + params.runtime + "</div>");
      });

      $("#uploadfiles").bind("click", function (e) {
         uploader.start();
         e.preventDefault();
      });

      uploader.init();

      uploader.bind("FilesAdded", function (up, files) {
         $.each(files, function (i, file) {
            $('#runtime').append(
                '<div id="' + file.id + '">' +
                    file.name + ' (' + plupload.formatSize(file.size) + ') <b></b>' +
           '</div>');
         });
         up.refresh();
      });

      uploader.bind("UploaderProgress", function (up, file) {
         $("#" + file.id + " b").html(file.percent + "%");
      });

      uploader.bind("Error", function (up, file) {
         $('#runtime').append("<div>Error: " + err.code +
                ", Message: " + err.message +
                (err.file ? ", File: " + err.file.name : "") +
                "</div>");
         up.refresh();
      });

      uploader.bind("FileUploaded", function (up, file) {
         $("#" + file.id + " b").html("100%");
      });

and HTML code

<div class="container">
                  <div>Logo: </div>
                  <div style="clear"></div>
                  <div id="uploader">
                    <div id="runtime" class="right">
                        No runtime was found !
                    </div>
                    <div>
                        <a id="pickfiles" href="#">[Select files]</a>
                        <a id="uploadfiles" href="#">[Upload files]</a>
                    </div>
                  </div>
               </div>

The error is shown in the following figure: enter image description here

http://i.imgur.com/5t0sT.jpg (for viewing in full size)

I see that this is a problem with file filters. I am running PLUpload.com examples in IE8 and it works fine with the Flash runtime.

In other browsers, my bootloader works fine. In addition, I installed the latest Flash for ALL browsers (IE8, FF9, Chrome 16), but the problem is in IE8.

RELEASE IS FIXED: Do not insert the uploader object into a div that has the visibility:hiddenor property display:none.

+5
source share
5 answers

, , :

HTML-

<div class="container" style="display:none">
                  <div>Logo: </div>
                  <div style="clear"></div>
                  <div id="uploader">
                    <div id="runtime" class="right">
                        No runtime was found !
                    </div>
                    <div>
                        <a id="pickfiles" href="#">[Select files]</a>
                        <a id="uploadfiles" href="#">[Upload files]</a>
                    </div>
                  </div>
</div>

container

$(function()
{
$(".container").dialog({modal:true, width:400});
});

, DIV - dispaly:none (, autoOpen:false ) .

IE8 (, ) , div . ( )

Chrome Firefox ( Opera) .

, - ( ).

display:none dialog div IE8.

? , IE , Firefox Chrome .

+5

div, :

uploader.refresh();

, !

+2

:

#pickfiles{
    display:block;
}

:

$('#pickfiles').on("mouseover",function(){
                $(".plupload.flash").css({
                    left:$('#pickfiles').offset().left+'px',
                    top:$('#pickfiles').offset().top+'px'
                    });
                });
+1

Install microsoft silverlight on your system. This will solve the problem and do not forget to give a message to your users to install silverligth.

-1
source

This bug resolved:

Add the "html4" properties to the properties: "runtimes"

var uploader = new plupload.Uploader({
        runtimes : 'gears,html5,flash,silverlight,browserplus,**html4**',
        browse_button : 'pickfiles_<? echo  $tmpKey ?>',
        container : 'container_<? echo  $tmpKey ?>',
        max_file_size : '30mb',
        url : '/image/upload3',
        flash_swf_url : '/plupload/js/plupload.flash.swf',
        silverlight_xap_url : '/plupload/js/plupload.silverlight.xap',
        filters : [
            {title : "Image files", extensions : "jpg,gif,png,jpeg"},
            {title : "Zip files", extensions : "zip"}
        ],
        unique_names:false,
        multipart_params : {
            "tmpPath" : "<? echo $tmpPath ?>",
            "minWidth" : "<? if(isset($minWidth)) echo $minWidth; else echo 0; ?>",
            "minHeight" : "<? if(isset($minHeight)) echo $minHeight; else echo 0; ?>"
        }
    //  resize : {width : 390, height : 290, quality : 90}
    });

Good luck to you!!!

-1
source

All Articles