plupload icon indicating copy to clipboard operation
plupload copied to clipboard

IE8 to select file ,appear SCRIPT601: 未知的运行时错误

Open zhang131 opened this issue 12 years ago • 10 comments

IE8 to select file ,appear SCRIPT601: 未知的运行时错误 plupload.full.min.js, 行15 字符10326。 I don't know why, How to solve?

zhang131 avatar Sep 26 '14 07:09 zhang131

the version 2.1.2

zhang131 avatar Sep 26 '14 07:09 zhang131

the js code

var uploader = new plupload.Uploader({
    runtimes : 'html5,flash,silverlight,html4',
    browse_button : 'adduploadfiles1', // you can pass in id...
    container: document.getElementById('container1'), 
    url : getRootPath()+'/userspace/mymessage/fileUploads!fileUploads.action',
    flash_swf_url : '../js/Moxie.swf',
    silverlight_xap_url : '../js/Moxie.xap',
    unique_names:true,
    multipart_params:{uploadparam:"licensePath"},
    filters : {
        max_file_size : '5mb',
        mime_types: [
            {title : "Image files", extensions : "jpg,gif,png"},
            {title : "Zip files", extensions : "zip"}
        ]
    },
    init: {
        PostInit: function() {
            document.getElementById('touploadfile1').onclick = function() {
                var count=uploader.files.length;
                if(count>1){
                    alert("最多只能上传一个");
                }else if(count==0){
                    alert("没有要上传的文件");
                }else{
                    uploader.start();
                }
                return false;
            };
        },
        FileUploaded: function(up, file,callback) {
            var oldpath=$.trim($("#licensePath").val());
            var backparam=callback.response.replace(/\"/g, "");
            $("#licensePath").val(oldpath+backparam+";");
            $("#down"+file.id).prop("href","javascript:downloadfile('"+backparam+"');");
            $("#del"+file.id).prop("href","javascript:delthisuploadfile('"+file.id+"','"+backparam+"',1)");
        },
        FilesAdded: function(up, files) {
            plupload.each(files, function(file) {
                var oldobj=document.getElementById("p_"+ file.id);
                var myTempFileName=file.name;
                if(myTempFileName.length>20){
                    deluploadfile(file.id,1);
                    alert("您上传文件"+myTempFileName+"的文件名长度大于20,请修改");
                    return ture;
                }
                if(oldobj==null ||oldobj==undefined)
                document.getElementById("filelist1").innerHTML+='<p class="clearfloat" id="p_' + file.id + '"><var><a href="javascript:downloadfile(\'\');" id="down'+file.id+'" title="'+file.name+'">' + 
                getLengthName(file.name) + ' </a>(' + plupload.formatSize(file.size) + ')<b></b></var><a href="javascript:delthisuploadfile(\''+file.id+'\',\'\',1);" id="del'+file.id+'">删除</a><span id="error_'+file.id+'"></span>';
            });
        },

        UploadProgress: function(up, file) {
            document.getElementById("p_"+file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + "%</span>";
        },
        UploadComplete:function(up,files){
        },
        Error: function(up, err) {
            var errcode=err.code;
            if(errcode==-600 ){
                alert(err.file.name+"文件大小已超过5Mb,请重新选择上传");
            }else if( errcode==-601 ){
                alert(err.file.name+"文件格式错误,请重新选择上传");
            }else{
                $("#error_"+err.file.id).text(err.message+" 请删除,重新上传");
            }
        }
    }
});
uploader.init();

zhang131 avatar Sep 26 '14 07:09 zhang131

我觉得你应该换个浏览器了。。。。。

sylingd avatar Sep 27 '14 11:09 sylingd

Could you try and load the unminified versions of the plupload and see if it produces more meaningful error message with exact line number. Check the examples/ folder inside the Plupload package. All examples have this in the header:

<!-- production -->
<script type="text/javascript" src="../js/plupload.full.min.js"></script>


<!-- debug 
<script type="text/javascript" src="../js/moxie.js"></script>
<script type="text/javascript" src="../js/plupload.dev.js"></script>
-->

Comment production block and uncomment debug block to load development versions of the scripts. Let us know if you get the error again and what it will be.

jayarjo avatar Sep 27 '14 12:09 jayarjo

It lets me select the files in IE8 with your code, but the rest of the logic obviously fails, since I do not have some of your functions defined. Although when I stub them, it works as expected.

You have a typo here btw:

                    deluploadfile(file.id,1);
                    alert("您上传文件"+myTempFileName+"的文件名长度大于20,请修改");
                    return ture;

return ture; probably is meant to be return true;

jayarjo avatar Sep 27 '14 12:09 jayarjo

I had modify return ture; but this proplem not resolve

zhang131 avatar Sep 28 '14 01:09 zhang131

What is the version of Flash player in your IE8? And please follow the instruction I posted above.

jayarjo avatar Sep 28 '14 08:09 jayarjo

Flash player version is 15

------------------ 原始邮件 ------------------ 发件人: "Davit Barbakadze"[email protected]; 发送时间: 2014年9月28日(星期天) 下午4:38 收件人: "moxiecode/plupload"[email protected]; 抄送: "禀圣含华"[email protected]; 主题: Re: [plupload] IE8 to select file ,appear SCRIPT601: 未知的运行时错误 (#1140)

What is the version of Flash player in your IE8? And please follow the instruction I posted above.

— Reply to this email directly or view it on GitHub.

zhang131 avatar Sep 30 '14 08:09 zhang131

The label you used is "p",just change it to "div".....

getOnce avatar Dec 09 '14 11:12 getOnce

hi, I have the same problem too. Have you solve it?

lilyAlucy avatar Jun 29 '16 08:06 lilyAlucy